From 5d2327929932bb18b0c683583f398855f0a31fed Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 23 Mar 2015 10:51:49 +0100 Subject: CURLOPT_PATH_AS_IS: added --path-as-is is the command line option Added docs in curl.1 and CURLOPT_PATH_AS_IS.3 Added test in test 1241 --- lib/url.c | 5 ++++- lib/urldata.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/url.c b/lib/url.c index 82faaf18a..e7d13d2d8 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2613,6 +2613,9 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, break; #endif + case CURLOPT_PATH_AS_IS: + data->set.path_as_is = (0 != va_arg(param, long))?TRUE:FALSE; + break; default: /* unknown tag and its companion, just ignore: */ result = CURLE_UNKNOWN_OPTION; @@ -4036,7 +4039,7 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data, path[0] = '/'; rebuild_url = TRUE; } - else { + else if(!data->set.path_as_is) { /* sanitise paths and remove ../ and ./ sequences according to RFC3986 */ char *newp = Curl_dedotdotify(path); if(!newp) diff --git a/lib/urldata.h b/lib/urldata.h index 01415b6ab..b1b1a678e 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1617,7 +1617,7 @@ struct UserDefined { bool ssl_enable_npn; /* TLS NPN extension? */ bool ssl_enable_alpn; /* TLS ALPN extension? */ - + bool path_as_is; /* allow dotdots? */ long expect_100_timeout; /* in milliseconds */ }; -- cgit v1.2.3