From 07058f6ad8e1d301291463c476615bc8a6733a11 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 7 Jun 2022 23:28:07 +0200 Subject: [PATCH] transfer: maintain --path-as-is after redirects Reported-by: Marcus T Fixes #8974 Closes #8975 --- lib/transfer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/transfer.c b/lib/transfer.c index 5367c03848..4f1b4b535e 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1607,7 +1607,8 @@ CURLcode Curl_follow(struct Curl_easy *data, uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl, (type == FOLLOW_FAKE) ? CURLU_NON_SUPPORT_SCHEME : ((type == FOLLOW_REDIR) ? CURLU_URLENCODE : 0) | - CURLU_ALLOW_SPACE); + CURLU_ALLOW_SPACE | + (data->set.path_as_is ? CURLU_PATH_AS_IS : 0)); if(uc) { if(type != FOLLOW_FAKE) return Curl_uc_to_curlcode(uc);