curl-library
Re: cURL behavior on 303 does not seem to be what is documented/advertised?
Date: Wed, 16 Jan 2013 08:51:13 -0800
> As for the redundant -H, it is there because I am using HTTP MAC and HTTP
> MAC requires that the host be encoded from the
> Host header. I thought about defaulting to the host from the connection
>in
> my code but decided I would rather require a Host header. Can I always
> rely on conn->allocptr.host being set at the time one generates an
> Authorization header? If so I'll switch to that.
So I have my answer, and it's no. I need Host: to be set when
Curl_output_http_auth is called. It seems that moving the code doing so
above of that call would not have a bad side effect so I'll do that.
YA
–––
Learn about GPT services and architectures on Confluence.
<http://confluence/display/GPT/GPT+Architecture>
On 1/16/13 8:16 AM, "Yves Arrouye" <yarrouye_at_expedia.com> wrote:
>> This is because you've explicitly told curl with -X that you want a POST
>>to be
>used. Why would you do that if you don't want that?
>
>I do want a POST. Curl did POST to the first URL, and got a 303. It then
>says (and that matches its man page for -L) that because it got a 303 it
>will then do a GET to the new location. It seems to still do a POST
>thoughŠ
>
>What would be the options that would make curl do a POST first and then a
>GET on the 303?
>
>As for the redundant -H, it is there because I am using HTTP MAC and HTTP
>MAC requires that the host be encoded from the
>Host header. I thought about defaulting to the host from the connection in
>my code but decided I would rather require a Host header. Can I always
>rely on conn->allocptr.host being set at the time one generates an
>Authorization header? If so I'll switch to that.
>
>YA
>
>Learn about GPT services and architectures on Confluence.
><http://confluence/display/GPT/GPT+Architecture>
>
>
>
>
>
>On 1/16/13 12:13 AM, "Daniel Stenberg" <daniel_at_haxx.se> wrote:
>
>>On Tue, 15 Jan 2013, Yves Arrouye wrote:
>>
>>> $ curl -LsS --data-binary 'foo=bar&lol=3' -X POST -H 'Host:
>>> paymentwallet.int-maui.karmalab.net' -k
>>> https://paymentwallet.int-maui.karmalab.net v
>>
>>...
>>
>>> [[[[LOOK HERE]]]]
>>> * Disables POST, goes with GET
>>
>>...
>>
>>>> POST / HTTP/1.0
>>
>>This is because you've explicitly told curl with -X that you want a POST
>>to be
>>used. Why would you do that if you don't want that?
>>
>>If you want to let curl do the "right" thing, just remove "-X POST" from
>>your
>>command line. Oh, and you should probably also consider to remove your
>>Host:
>>thing that seems superfluous as well.
>>
>>--
>>
>> / daniel.haxx.se
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-16