-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
When request content in chunks, PapaParse may trigger HTTP 416 (Range Not Satisfiable) Error under the following two situation:
- we always calculate
endas:var end = this._start + this._config.chunkSize - 1;see here. This likely always makethe last chunkrequest to request a range that is beyond the actual file size (unless the actual last chunk size is just equal to thethis._config.chunkSize.) Many servers will responseHTTP 416error for this.- Solution: use
Content-Rangeheader to retrieve the actual file size and useactual content size - 1as theendfor the last chunk
- Solution: use
- As we often don't know the actual size of the target file before we request it, it's possible the
this._config.chunkSizeis configured to a size that is larger than the file size. e.g. the file is only 100 bytes and this._config.chunkSize is configured to 64KB. When this happens, PapaParse will always fail on the first chunk request due to HTTP 416 (Range Not Satisfiable) Error- Solution: we should retry (only once) on the first chunk request without Range header on 416 error
JannickKemming1997, walerian777, vedmakk, RoelRoel and gssrdnl
Metadata
Metadata
Assignees
Labels
No labels