Menu

#744 Redirect to relative URI (only query string)

closed-fixed
http (206)
5
2013-06-21
2008-05-26
Felix
No

I'm trying to load a resource that answers with a relative location header that is just a query string. Curl builds a wrong absolute URI to follow:

Assuming the resource is "http://example.com/blarg/blarg"

Server Response:
HTTP/1.1 302 Found
Date: Mon, 26 May 2008 18:45:57 GMT
Server: Apache
Location: ?x=1

I now would Curl expect to follow to "http://example.com/blarg/blarg?x=1"

But the next request looks like this:
GET /?x=1 HTTP/1.1
Host: example.com
Accept: */*

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2008-05-26
    • milestone: --> wrong_behaviour
    • assigned_to: nobody --> bagder
    • labels: --> http
     
  • Daniel Stenberg

    Daniel Stenberg - 2008-05-26

    Logged In: YES
    user_id=1110
    Originator: NO

    Is that what the ordinary browsers do on such redirects?

     
  • Daniel Stenberg

    Daniel Stenberg - 2008-05-26

    Logged In: YES
    user_id=1110
    Originator: NO

    What curl version is that? I can't repeat that exact behavior (although I can see that it won't just append the new query string)

     
  • Daniel Stenberg

    Daniel Stenberg - 2008-05-26
    • status: open --> pending-fixed
     
  • Daniel Stenberg

    Daniel Stenberg - 2008-05-26

    Logged In: YES
    user_id=1110
    Originator: NO

    Fixed and committed to CVS just now. New test case 1031 verifies this. If you can, please get the code from CVS or tomorrow's daily snapshot and see that this fix actually corrects the problem for you!

     
  • Felix

    Felix - 2008-05-27

    Logged In: YES
    user_id=2099045
    Originator: YES

    I have tried today's snapshot to verify your fix: Works as expected. Thanks a lot for the quick fix!

     
  • Felix

    Felix - 2008-05-27
    • status: pending-fixed --> open-fixed
     
  • Daniel Stenberg

    Daniel Stenberg - 2008-05-27

    Logged In: YES
    user_id=1110
    Originator: NO

    Thanks for verifying. Case closed!

     
  • Daniel Stenberg

    Daniel Stenberg - 2008-05-27
    • status: open-fixed --> closed-fixed