urlapi: allow more path characters "raw" when asked to URL encode

Setting the path component to contain the letters:

    ! $ & ' ( ) { } [ ] * + , ; = : @

now leaves them un-encoded when CURLU_URLENCODE is used.

Amended test 1560 to verify.

Reported-by: Jeroen Ooms
Fixes #17977
This commit is contained in:
Daniel Stenberg 2025-07-24 18:36:28 +02:00
parent 1055144063
commit 768c0f0779
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 24 additions and 5 deletions

View file

@ -184,8 +184,10 @@ course cannot know if the provided scheme is a valid one or not.
When set, curl_url_set(3) URL encodes the part on entry, except for
**scheme**, **port** and **URL**.
When setting the path component with URL encoding enabled, the slash character
is skipped.
When setting the path component with URL encoding enabled, the following
characters are left as-is if present:
! $ & ' ( ) { } [ ] * + , ; = : @
The query part gets space-to-plus converted before the URL conversion is
applied.