-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/curl: Add CURLINFO_{USED_PROXY,HTTPAUTH_USED,PROXYAUTH_USED}
#17816
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
Conversation
29a3b7d
to
f6eccf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise it s very much correct, not entirely sure however how others will think of the online test.
Thank you @devnexen - I couldn't think of a way to test it with a local server. That said, we don't seem to be testing a lot of proxy/auth related features, nor any of the HTTP/2, HTTP/3, DoH, etc features either, so the online test is understandably a bit out of place. If it makes more sense, I can remove the online test. |
Can we use Caddy instead of the online test? Caddy was introduced via #10669, and is used for a couple of tests (some jobs are actually running that). |
1c47f1d
to
47a8e73
Compare
Thank you @cmb69. I pushed removing httpbin, and with a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[…] but GH-Actions run will get skipped because the Curl version is older than 8.12.0.
It would be good to also have a job using recent cURL; possibly on Windows, since we're rather up to date there (at least for the master
branch), but this is a separate issue.
Please see my comment below; I guess that should solve the Windows CI failure.
19b93c4
to
7eebe32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Adds support for `curl_getinfo()` info keys and additional array keys: - [`CURLINFO_USED_PROXY`](https://curl.se/libcurl/c/CURLINFO_USED_PROXY.html) - `libcurl` >= 8.7.9 - Zero if no proxy was used in the previous transfer or a non-zero value if a proxy was used. - [`CURLINFO_HTTPAUTH_USED`](https://github.com/curl/curl/blob/curl-8_12_0/docs/libcurl/opts/CURLINFO_HTTPAUTH_USED.md) - `libcurl` >= 8.7.9 - Bitmask indicating the authentication method that was used in the previous HTTP request. - [`CURLINFO_PROXYAUTH_USED`](https://github.com/curl/curl/blob/curl-8_12_0/docs/libcurl/opts/CURLINFO_PROXYAUTH_USED.md) - `libcurl` >= 8.12.0 - Bitmask indicating the authentication method that was used in the previous request done over an HTTP proxy. ```php curl_getinfo($ch); ``` ```php [ // ... "used_proxy" => 0, "httpauth_used" => 0, "proxyauth_used" => 0, ] ``` This also updates the `Caddyfile` for curl tests to add a new route that supports HTTP basic auth.
7eebe32
to
6a31992
Compare
Adds support for
curl_getinfo()
info keys and additional array keys:CURLINFO_USED_PROXY
-libcurl
>= 8.7.9 - Zero if no proxy was used in the previous transfer or a non-zero value if a proxy was used.CURLINFO_HTTPAUTH_USED
-libcurl
>= 8.7.9 - Bitmask indicating the authentication method that was used in the previous HTTP request.CURLINFO_PROXYAUTH_USED
-libcurl
>= 8.12.0 - Bitmask indicating the authentication method that was used in the previous request done over an HTTP proxy.Because the built-in server ext/curl tests use does not support HTTP authentication, there is an online test that uses httpbin. It will be skipped by default unless online tests are run.