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

HTTP Method "HEAD" not implemented correctly #51

Closed
manioc2015 opened this issue May 3, 2017 · 3 comments
Closed

HTTP Method "HEAD" not implemented correctly #51

manioc2015 opened this issue May 3, 2017 · 3 comments

Comments

@manioc2015
Copy link

The HTTP HEAD method is not implemented correctly. Instead of passing in HEAD as the CURLOPT_CUSTOMREQUEST, the CURLOPT_NOBODY option should be set instead. The bug results in slow and hanging HEAD requests.

Proposed Fix:
Line 275:
} elseif ($method === 'head') {
curl_setopt($this->ch, CURLOPT_NOBODY, 1);

@anlutro
Copy link
Owner

anlutro commented May 3, 2017

Which server(s) are you seeing this behaviour with? I added a HEAD request test in the functional test and that doesn't seem to hang, but maybe that's just the PHP built-in server's behaviour.

I also wonder if setting CURLOPT_NOBODY should be done in other cases, like DELETE.

@manioc2015
Copy link
Author

I tried https://www.google.com and https://www.amazon.com. Both just hangs and hangs. When I request a static mp3 file on an Apache server there is a noticeable delay.

@anlutro anlutro closed this as completed in a5043bd May 5, 2017
@anlutro
Copy link
Owner

anlutro commented May 5, 2017

Thanks for letting me know and sorry for the slow response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants