gnarroway / hato

An HTTP client for Clojure, wrapping JDK 11's HttpClient
MIT License
380 stars 27 forks source link

Automatic body decompressions should work with mixed casing content-encoding #28

Closed vincentjames501 closed 3 years ago

vincentjames501 commented 3 years ago

If a server responds with:

{:headers {"content-encoding" "GZip"
                  "other-headers"        ""}}

Hato does not do automatic decompression of the body. Note the casing of GZip as it appears hato is expecting it be lower-cased gzip instead. According to RFC2616 section 3.5 specifies: "All content-coding values are case-insensitive." I just ran into this case with Hato when exploring a new API that returned GZip instead.

Seems like a simple str/lower-case may help here?

gnarroway commented 3 years ago

Thanks for this! Released with 0.8.1