diff options
author | Joey Hess <joey@kitenet.net> | 2012-02-10 21:42:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-02-10 21:54:25 -0400 |
commit | ecfcb41abe5c2903ca80d26365afdf20faaf9989 (patch) | |
tree | bdc4fde7dbf6f0ab564d786732e2baf79663b9f3 /Git | |
parent | 6335abcab2c0b48132b04011acbd01fb99bc5b53 (diff) |
work around Network.Browser bug that converts a HEAD to a GET when following a redirect
The code explicitly switches from HEAD to GET for most redirects.
Possibly because someone misread a spec (which does require switching from
POST to GET for 303 redirects). Or possibly because the spec really is that
bad. Upstream bug: https://github.com/haskell/HTTP/issues/24
Since we absolutely don't want to download entire (large) files from
the web when checking that they exist with HEAD, I wrote my own redirect
follower, based closely on the one used by Network.Browser, but without
this misfeature.
Note that Network.Browser checks that the redirect url is a http url
and fails if not. I don't, because I want to not need to change this
code when it gets https support (related: I'm surprised to see it
doesn't support https yet..). The check does not seem security significant;
it doesn't support file:// urls for example. If a http url is redirected
to https, the Network.Browser will actually make a http connection again.
This could loop, but only up to 5 times.
Diffstat (limited to 'Git')
0 files changed, 0 insertions, 0 deletions