inspirehep / inspire-next

The INSPIRE repo.
https://inspirehep.net
GNU General Public License v3.0
59 stars 69 forks source link

PDF with compressed content-encoding are not decompressed #2408

Closed kaplun closed 7 years ago

kaplun commented 7 years ago

Expected Behavior

If servers serve us with content-encoding: gzip, we should on the fly decode it.

Current Behavior

This is currently not happening. So in: https://github.com/inspirehep/inspire-next/blob/master/inspirehep/modules/workflows/utils.py#L177 we are serving gzipped data.

kaplun commented 7 years ago

This is related with many failed user submssion @annetteholtkamp is reporting (because we delivery to legacy a data file with the gzipped PDF rather than the actual PDF.

jacquerie commented 7 years ago

Looks like we were victim of this subtlety in the documentation: https://github.com/requests/requests/issues/2155#issuecomment-50885814. Luckily, https://github.com/requests/requests/issues/2155#issuecomment-287628933 should work for us.