After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 575378 - when redirecting, should be more liberal with Location URIs
when redirecting, should be more liberal with Location URIs
Status: RESOLVED DUPLICATE of bug 566530
Product: libsoup
Classification: Core
Component: HTTP Transport
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2009-03-14 18:29 UTC by Gustavo Noronha (kov)
Modified: 2009-03-23 21:36 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
small test case (1.14 KB, text/plain)
2009-03-14 18:31 UTC, Gustavo Noronha (kov)
Details

Description Gustavo Noronha (kov) 2009-03-14 18:29:46 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.
Comment 1 Gustavo Noronha (kov) 2009-03-14 18:31:48 UTC
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.
Comment 2 Dan Winship 2009-03-14 21:51:53 UTC
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.
Comment 3 Gustavo Noronha (kov) 2009-03-15 13:40:27 UTC
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.
Comment 4 Dan Winship 2009-03-23 21:36:52 UTC
this is really just another case of 566530

*** This bug has been marked as a duplicate of 566530 ***