-
Notifications
You must be signed in to change notification settings - Fork 8k
Export ext/curl's primary header #5335
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
This makes it more accessible to extensions.
Which part of the header do you need? We may need to do a public/private split, in particular to avoid exporting structures for ABI reasons. |
Windows part looks good to me (headers are then available in devel-packs). |
I'm not 100% sure at this point. For things like OpenTelemetry (and of course ddtrace) I want to add the W3C trace context automatically to curl requests. We started work in the past for ddtrace, but hit some blockers that I don't remember. One pain point was that these headers weren't exported at all, which is why I am exporting it now. |
If this makes you nervous, perhaps we could write a new function which handles the use case of appending some headers and just export that? I'm worried that may not be sufficient for everyone, but something is better than nothing, which is what we had before. |
@morrisonlevi Would it be sufficient for you to get access to the |
I don't think so. PHP stores the headers in a PHP array (I think, if I am reading this correctly) and then at exec time it converts it to a curl_slist and sends it. Regardless of how it works, I need access to the I think there are other things that would be nice, such as having access to HTTP method and URL. I think these can be accessed from the |
That happens either during the respective |
Immediate thoughts on that:
I think minimizing the API exposed to extensions and such is a good idea, but I don't think the current code is set up very well for that. So far, my best idea would be to expose only the |
Ah, now I understand (I thought it is about the postfields). If you need to append to |
I don't know if it's useful information for you, but I wanted to share just in case, that I started working on migrating the curl handle to an object. |
@kocsismate Glad to hear it! How close is the work to being ready for review? |
@morrisonlevi I haven't reached far yet because I gave priority to other stuff, but I'll come back to this task this week. |
This makes it more accessible to extensions.
Disclaimer: I have no idea if this is helpful or correct on Windows builds.