Open hi-ogawa opened 1 month ago
Content-Encoding should be used only when sirv is serving pre-compressed files (e.g. request: test.csv --> response: test.csv.gz), but it should be avoided when users are requesting a compressed file directly (e.g. test.csv.gz).
Content-Encoding
Citing from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
If the original media is encoded in some way (e.g. a zip file) then this information would not be included in the Content-Encoding header.
The summary of changes in this PR is:
extns: string
extns: { ext: string, encoded: boolean }[]
viaLocal
viaCache
{ name: string, encoded: boolean }
Content-Type
toHeaders
send
name
encoded
Diff looks a little involved, but I hope this is clear and correct. I would appreciate a review. Thanks!
Content-Encoding
should be used only when sirv is serving pre-compressed files (e.g. request: test.csv --> response: test.csv.gz), but it should be avoided when users are requesting a compressed file directly (e.g. test.csv.gz).Citing from https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
The summary of changes in this PR is:
extns: string
withextns: { ext: string, encoded: boolean }[]
,viaLocal
orviaCache
, it also returns{ name: string, encoded: boolean }
Content-Type
andContent-Encoding
handling fromtoHeaders
tosend
since it now requiresname
andencoded
to decide these two headers.Diff looks a little involved, but I hope this is clear and correct. I would appreciate a review. Thanks!