common: set CURLOPT_UNRESTRICTED_AUTH during http requests #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the task
Sometimes people can post a link with a wrong scheme by accident. In this case the github api is doing the right thing, returning a redirection. But when curl follows this redirection it will drop the
Authorization
header.https://curl.se/libcurl/c/CURLOPT_UNRESTRICTED_AUTH.html
How to test
Setup a tiny http server which does a redirection and logs the headers it receives
Start it with
python3 demo.py
From utop (
dune utop
):With the change from this PR you'll see
Authorization: token louis
. With the code from master the header is missingThis behavior can be reproduced with the curl cli
--location-trusted
is the same asCURLOPT_UNRESTRICTED_AUTH