OPTIONS does not add headers #26

Closed
pegli opened this Issue Sep 22, 2011 · 1 comment

Projects

None yet

2 participants

@pegli

When I add headers using -H "Header-Name: value" to the end of an OPTIONS command, the header isn't present in the request. To reproduce:

% resty http://www.w3c.org
% OPTIONS / -v -H "Origin: http://www.google.com/"
* <url> malformed
* <url> malformed
* About to connect() to www.w3c.org port 80 (#0)
*   Trying 128.30.52.45... connected
* Connected to www.w3c.org (128.30.52.45) port 80 (#0)
> OPTIONS / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: www.w3c.org
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Cache-Control: no-cache
< Content-length: 0
< Location: http://www.w3.org/
< Connection: close
...

Note that the "Origin" header is missing. This command works correctly:

% curl -X OPTIONS -H "Origin: http://www.google.com/" -v http://www.w3c.org/ 

* About to connect() to www.w3c.org port 80 (#0)
*   Trying 128.30.52.45... connected
* Connected to www.w3c.org (128.30.52.45) port 80 (#0)
> OPTIONS / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: www.w3c.org
> Accept: */*
> Origin: http://www.google.com/
> 
< HTTP/1.1 301 Moved Permanently
< Cache-Control: no-cache
< Content-length: 0
< Location: http://www.w3.org/
< Connection: close
@micha micha added a commit that referenced this issue Sep 23, 2011
@micha Fixes issue gh-26 where curl options were not being correctly passed …
…to curl for HEAD or OPTIONS requests
58560a1
@micha
Owner

Should be fixed now, thanks for letting me know!

@micha micha closed this Sep 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment