#3859 http://dl.fedoraproject.org sends incorrect content-encoding header
Closed: Fixed None Opened 9 years ago by mhrivnak.

= bug description =
When downloading a file from dl.fedoraproject.org that is gziped, such as any file at the following URL that ends in .gz:

http://dl.fedoraproject.org/pub/fedora/linux/releases/18/Everything/x86_64/os/repodata/

... apache is sending the header "Content-Encoding: x-gzip", which is incorrect. This is a violation of RFC 2616.

= bug analysis =
The RFC describes the Content-Encoding header as: "what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type header field." Since the Content-Type header is also sent with a value of "application/x-gzip", it is incorrect to state that gzip decoding must be applied in order to obtain a gzip content type.

This behavior also happens regardless of whether the request's Accept-Encoding value permits gzip encoding. This violates a SHOULD clause in the RFC.

This error seems to be common enough that many libraries, such as curl, ignore the bogus Content-Encoding value. Presumably they recognize that the file's name ends in "gz" and then decline to decode with gzip. However, other libraries follow the RFC. I encountered this bug while using the python "requests" library.

= fix recommendation =

Look in the apache config for something like "AddEncoding x-gzip .gz", which could be to blame.


What pros/cons would we experience if we remove that specific AddEncoding line?

We are done with freeze now and I pushed this change. The AddEncodings are gone and things work as you expect.

Please re-open if you still see any issues.

Login to comment on this ticket.

Metadata