Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add download progress example #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AuHau
Copy link
Contributor

@AuHau AuHau commented Jan 28, 2022

No description provided.

@vojtechsimetka
Copy link
Contributor

vojtechsimetka commented Mar 21, 2022

@AuHau I see the header decompressed-content-length does not work without CORS disabled. It is not listed in the e.target.getAllResponseHeaders() and if I try to access it browser complains with Refused to get unsafe header "decompressed-content-length". It took me quite some time to figure this out, maybe we should document this in readme, hmm? :)

<input id="reference" type="text" placeholder="Reference" required size="64">
<input id="download" type="submit" value="Download!">
</form>

<br><br>
Logging progress:
<div id="content">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div id="content">
<div id="logs">

Comment on lines +40 to +41
e.total = e.target.getResponseHeader('decompressed-content-length')
progressCb(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an assignment to private variable.

Suggested change
e.total = e.target.getResponseHeader('decompressed-content-length')
progressCb(e)
progressCb({...e, total: e.target.getResponseHeader('decompressed-content-length')})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants