GNOME Bugzilla – Bug 575378
when redirecting, should be more liberal with Location URIs
Last modified: 2009-03-23 21:36:52 UTC
We're having problems in WebKitGTK+, because misbehaving servers sometimes send bad URIs in their Location headers, when redirecting. For example, searches in thepiratebay.org usually cause a redirect with whatever is written in their search entry as part of the URI, which ends up in a bad request (HTTP status code 400). I'm attaching a small test program.
Created attachment 130675 [details] small test case As you'll be able to see, this requests a proper URI, which causes a redirect with a broken URI as its Location:, and then we have a 400 error.
the brokenness here is: Location: /search/foo bar/0/99/0 (ie, the '+' in the request URI gets unescaped to ' '), which causes us to generate: GET http://thepiratebay.org/search/foo bar/0/99/0 HTTP/1.1 which is a Bad Request because the URL ends at the first space and "bar/0/99/0" gets interpreted as the HTTP version. The fix is probably to make SoupURI add %-escaping in cases where the passed-in URL is obviously syntactically incorrect like this.
Yeah. I made a small patch to WebKit's soup backend to work this around while we fix it in soup proper. I will try to cook a patch during the week. The webkit patch: https://bugs.webkit.org/show_bug.cgi?id=24602.
this is really just another case of 566530 *** This bug has been marked as a duplicate of 566530 ***