Menu

#1114 "Content-Encoding: gzip" ignored under certain condition

closed-invalid
http (206)
5
2013-06-21
2012-05-23
No

When "Content-Disposition: attachment" is present libcurl will not decode response body.

Example:
$ curl -I http://slivmail.com/messages/original/40098
HTTP/1.1 200 OK
Content-Type: message/rfc822
Connection: keep-alive
Status: 200
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.12
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Disposition: attachment; filename="001f93~2.eml"
Content-Transfer-Encoding: binary
Cache-Control: private
X-UA-Compatible: IE=Edge,chrome=1
X-Request-Id: 9ec69f7ff77b534ff8eff797cb33c5fd
X-Runtime: 0.003493
Date: Wed, 23 May 2012 20:48:46 GMT
X-Rack-Cache: miss
Server: nginx/1.0.15 + Phusion Passenger 3.0.12 (mod_rails/mod_rack)

Discussion

  • Dan Fandrich

    Dan Fandrich - 2012-05-23

    Can you be more specific? How does it not decode the response body? What does it output given the command: curl -v -O --compressed http://slivmail.com/messages/original/40098

     
  • Lux In Tenebris

    Lux In Tenebris - 2012-05-23

    curl -v -O --compressed works fine, curl writes uncompressed data

     
  • Lux In Tenebris

    Lux In Tenebris - 2012-05-23

    curl 7.25.0 (x86_64-pc-linux-gnu) libcurl/7.25.0

     
  • Dan Fandrich

    Dan Fandrich - 2012-05-23

    So, what's the problem then?

     
  • Lux In Tenebris

    Lux In Tenebris - 2012-05-23

    I expect than libcurl will detect the presence of "Content-Encoding: gzip" and uncompress gzip data automatically when writing to a file.

     
  • Dan Fandrich

    Dan Fandrich - 2012-05-23
    • status: open --> open-invalid
     
  • Dan Fandrich

    Dan Fandrich - 2012-05-23

    And, three comments earlier you said it does. curl will only decompress automatically when given the --compressed option. Otherwise, it returns the raw contents. Have you found documentation that suggests otherwise?

     
  • Daniel Stenberg

    Daniel Stenberg - 2012-05-25
    • status: open-invalid --> pending-invalid
     
  • Daniel Stenberg

    Daniel Stenberg - 2012-05-25

    Thanks for reporting this issue and helping us improve curl and libcurl.

    We're awaiting feedback in this issue. Due to this, I have set the state of this issue to pending and it will automatically get closed later on unless we get further info.

    Please consider answering the outstanding questions or providing the missing info so that we can proceed to resolve this issue!

     
  • Daniel Stenberg

    Daniel Stenberg - 2012-06-03
    • status: pending-invalid --> closed-invalid
     
MongoDB Logo MongoDB