Linksharing ZIP support should return compressed content when presented with valid, complex Accept-Encoding strings.
Current Behavior
Linksharing uses simplified Accept-Encoding parsing which does not detect all requests for compressed content.
Possible Solution
Implement more robust Accept-Encoding parsing.
Steps to Reproduce
Send request with Accept-encoding header br;q=1.0, gzip;q=0.8, *;q=0.1 when requesting content from a ZIP file
Context (Environment)
Accept-Encoding is a forbidden HTTP header according to the Fetch spec. Thus it can't be precisely set from Javascript, and instead relies on what the browser sends. This breaks Linksharing's ability to send compressed ZIP content to a browser, as browsers tend to deliver more complex strings.
Expected Behavior
Linksharing ZIP support should return compressed content when presented with valid, complex
Accept-Encoding
strings.Current Behavior
Linksharing uses simplified
Accept-Encoding
parsing which does not detect all requests for compressed content.Possible Solution
Implement more robust
Accept-Encoding
parsing.Steps to Reproduce
Accept-encoding
headerbr;q=1.0, gzip;q=0.8, *;q=0.1
when requesting content from a ZIP fileContext (Environment)
Accept-Encoding is a forbidden HTTP header according to the Fetch spec. Thus it can't be precisely set from Javascript, and instead relies on what the browser sends. This breaks Linksharing's ability to send compressed ZIP content to a browser, as browsers tend to deliver more complex strings.
Detailed Description
Use better
Accept-Encoding
parser logic instead of https://github.com/storj/edge/blob/0c1c0d33f8330aba580729d7851aa44ddbb475ba/pkg/linksharing/sharing/present.go#L214Possible Implementation
Another nice-to-have here might be a URL parameter or non-forbidden header to fall back on.