Skip to content

Make curl_url_set(url, CURLUPART_URL, NULL, 0) clear all parts#9028

Closed
adoy wants to merge 1 commit into
curl:masterfrom
adoy:clear-url
Closed

Make curl_url_set(url, CURLUPART_URL, NULL, 0) clear all parts#9028
adoy wants to merge 1 commit into
curl:masterfrom
adoy:clear-url

Conversation

@adoy
Copy link
Copy Markdown
Contributor

@adoy adoy commented Jun 19, 2022

As per the documentation :

Setting a part to a NULL pointer will effectively remove that
part's contents from the CURLU handle.

But currently clearing CURLUPART_URL does nothing and returns
CURLUE_OK. This change will clear all parts of the URL at once.

Copy link
Copy Markdown
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus points for the test!

Comment thread lib/urlapi.c Outdated
As per the documentation :

> Setting a part to a NULL pointer will effectively remove that
> part's contents from the CURLU handle.

But currently clearing CURLUPART_URL does nothing and returns
CURLUE_OK. This change will clear all parts of the URL at once.
@bagder
Copy link
Copy Markdown
Member

bagder commented Jun 20, 2022

Thanks!

@bagder bagder closed this in 4bf2c23 Jun 20, 2022
@adoy adoy deleted the clear-url branch July 20, 2022 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants