Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OPTIONS * requests #1280

Closed
BigBlueHat opened this issue Feb 22, 2017 · 3 comments
Closed

Support OPTIONS * requests #1280

BigBlueHat opened this issue Feb 22, 2017 · 3 comments

Comments

@BigBlueHat
Copy link

BigBlueHat commented Feb 22, 2017

I did this

curl -v -X OPTIONS "*" -H 'Host: www.w3.org' -H 'Upgrade: TLS/1.0' -H 'Connection: Upgrade'

while exploring RFC 2817. It resulted in a request being sent, but * got rewritten to a request for */.

I expected the following

The standard OPTIONS * to be sent....but then I found:
http://stackoverflow.com/a/36933053/507169

This is known as the asterisk-form in RFC7230.

curl/libcurl version

curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3

operating system

Linux Subsystem (Ubuntu) on Windows 10


Thanks for considering this!

@bagder bagder added the HTTP label Feb 23, 2017
@bagder
Copy link
Member

bagder commented Feb 23, 2017

The use of the asterisk like that on the command line isn't expected to work and it will never work like that. It will instead work as a wildcard by the shell and then most likely get treated as a separate URL.

curl doesn't have the ability to send an "OPTIONS *" request as it will always send at least a slash. We've discussed making it possible to do so in the past, but nobody has yet pulled that through or provided the necessary code changes.

@BigBlueHat
Copy link
Author

Thanks, @bagder. I should've focused on the quoted example. It seems like it would be a simple patch...but I'm sadly am not setup to code and test C...

I will change my request, though, to focus on the "*" usage only.

Here's the pertinent bit from the latest HTTP spec: https://tools.ietf.org/html/rfc7230#section-5.3.4

Thanks!

@bagder bagder closed this as completed in ed74c64 Feb 23, 2017
@bagder
Copy link
Member

bagder commented Feb 23, 2017

Thanks, now properly added in the TODO referring back to this issue.

bagder added a commit that referenced this issue May 3, 2017
... to support sending "OPTIONS *" which wasn't possible previously.

Fixes #1280

To discuss:

1. Command line option name.
2. should --include be implied?
bagder added a commit that referenced this issue May 4, 2017
... to enable sending "OPTIONS *" which wasn't possible previously.

This option currently only works for HTTP.

Added test case 1147 to verify

Fixes #1280
bagder added a commit that referenced this issue May 5, 2017
... to enable sending "OPTIONS *" which wasn't possible previously.

This option currently only works for HTTP.

Added test case 1147 to verify

Fixes #1280
bagder added a commit that referenced this issue Jun 15, 2017
... to enable sending "OPTIONS *" which wasn't possible previously.

This option currently only works for HTTP.

Added test case 1147 to verify

Fixes #1280
bagder added a commit that referenced this issue Jun 15, 2017
... to enable sending "OPTIONS *" which wasn't possible previously.

This option currently only works for HTTP.

Added test case 1299 to verify

Fixes #1280
bagder added a commit that referenced this issue Jun 15, 2017
... to enable sending "OPTIONS *" which wasn't possible previously.

This option currently only works for HTTP.

Added test case 1299 to verify

Fixes #1280
bagder added a commit that referenced this issue Jun 19, 2017
... to enable sending "OPTIONS *" which wasn't possible previously.

This option currently only works for HTTP.

Added test cases 1298 + 1299 to verify

Fixes #1280
Closes #1462
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants