Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Redirect overwrites `CURLOPT_URL` option value when `CURLOPT_FOLLOWLOCATION` used. #1631
Libcurl is used by the following scheme:
The code uses
After some request was finished by redirect, subsequent requests are done to new location, not to location set by
That is unexpected and undocumented behaviour.
It is expected that subsequent calls to
IMHO, something required to be changed - code or documentation.
What do you think?
7.38.0 (yes, it is quite old, but I found no issue-related changes in current 7.54.1 version too)
Related Collectd issue: collectd/collectd#2328
At the https://curl.haxx.se/libcurl/c/curl_easy_perform.html page there is the following note:
But it is unclear if it is general requirement or only related to 'more than one file transfer', which requires to change file URL.
... since CURLOPT_URL should follow the same rules as other options: they remain set until changed or cleared. Added test 1551 to verify. Fixes #1631 Reported-by: Pavel Rochnyak