cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: OPTIONS * requests

From: Nicholas Shanks <nickshanks_at_nickshanks.com>
Date: Thu, 25 Aug 2016 22:20:35 +0100

On Thursday, 25 August 2016, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 25 Aug 2016, Tatsuhiro Tsujikawa wrote:
>
> Actually, OPTIONS is very interesting method. Doing this without proxy is
>> "OPTIONS * HTTP/1.1". ​According to ​http://tools.ietf.org/html/rf
>> c7230#section-5.3.4, when we perform server-wide via HTTP/1 proxy, we
>> send "OPTIONS http://example.org HTTP/1.1". Watch out for the absence of
>> last "/". This is critical. Adding "/" means OPTIONS request to "/", which
>> is not server-wide request.
>>
>
> Very good point! That could possibly count as another argument for an
> option like --strip-the-initial-slash-from-the-request-path and then have
> it strip (or not add) the trailing slash to the host name there.
>

As someone without legacy code, doing
$ curl -X OPTIONS http://www.example.com
Would be my preferred choice, but I can easily see that existing code would
expect that to be equal to
$ curl -X OPTIONS http://www.example.com/

Maybe OPTIONS is so infrequently used that the minor potential
breakage isn't a concern?

How does curl format request lines with the host present?

-- 
Nicholas.

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-08-25