diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-10-01 09:54:21 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-10-02 07:53:32 +0200 |
commit | c6f250c4d6a8964a24d99aaf0e0cb81ab9cb293f (patch) | |
tree | df2b76228df97f24fd84956f542f4602e90aca14 /lib | |
parent | 2c20109a9b5d0499a14a0226e68d55d027ecdb20 (diff) |
redirect: when following redirects to an absolute URL, URL encode it
... to make it handle for example (RFC violating) embeded spaces.
Reported-by: momala454 on github
Fixes #4445
Closes #4447
Diffstat (limited to 'lib')
-rw-r--r-- | lib/transfer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 44aa10971..421c8d2d0 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1591,7 +1591,8 @@ CURLcode Curl_follow(struct Curl_easy *data, DEBUGASSERT(data->state.uh); uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl, - (type == FOLLOW_FAKE) ? CURLU_NON_SUPPORT_SCHEME : 0); + (type == FOLLOW_FAKE) ? CURLU_NON_SUPPORT_SCHEME : + ((type == FOLLOW_REDIR) ? CURLU_URLENCODE : 0) ); if(uc) { if(type != FOLLOW_FAKE) return Curl_uc_to_curlcode(uc); |