[issue22450] urllib doesn't put Accept: */* in the headers

Martin Panter report at bugs.python.org
Sun Nov 1 04:30:43 EST 2015


Martin Panter added the comment:

According to all the HTTP 1.1 RFCs, having */* at the end means you accept any other content type if none of the higher priority ones are available (otherwise you risk a 406 Not Acceptable error). So that explains why Firefox has */* tacked on.

Requests copied from Curl: <https://github.com/kennethreitz/requests/commit/6140fac>. Similarly, it is in urllib3 “because that’s what cURL had by default”. Brief discussion at <https://github.com/shazow/urllib3/pull/93#issuecomment-8209904>, where they decided to leave things as they already were.

So all roads seem to lead to Curl. Curl’s “initial revision” (Dec 1999) had “Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*”, which was changed to “Accept: */*” in <https://github.com/bagder/curl/commit/93e32e6> in 2004. I don’t see any reasons given. I just left a question on Git Hub about this, so maybe we might get some sort of answer.

Wget also includes “Accept: */*”. But it gives no explanations either, and it was present right from the “initial revision” also in Dec 1999 (presumably Source Forge started about then).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22450>
_______________________________________


More information about the Python-bugs-list mailing list