1CURLOPT_PATH_AS_IS(3)      curl_easy_setopt options      CURLOPT_PATH_AS_IS(3)
2
3
4

NAME

6       CURLOPT_PATH_AS_IS - do not handle dot dot sequences
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PATH_AS_IS, long leaveit);
12

DESCRIPTION

14       Set  the long leaveit to 1, to explicitly tell libcurl to not alter the
15       given path before passing it on to the server.
16
17       This instructs libcurl to NOT squash sequences of "/../" or "/./"  that
18       may exist in the URL's path part and that is supposed to be removed ac‐
19       cording to RFC 3986 section 5.2.4.
20
21       Some server implementations are known to (erroneously) require the  dot
22       dot sequences to remain in the path and some clients want to pass these
23       on in order to try out server implementations.
24
25       By default libcurl will merge such sequences before using the path.
26

DEFAULT

28       0
29

PROTOCOLS

31       All
32

EXAMPLE

34       CURL *curl = curl_easy_init();
35       if(curl) {
36         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/../../etc/password");
37
38         curl_easy_setopt(curl, CURLOPT_PATH_AS_IS, 1L);
39
40         curl_easy_perform(curl);
41       }
42

AVAILABILITY

44       Added in 7.42.0
45

RETURN VALUE

47       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
48       if not.
49

SEE ALSO

51       CURLOPT_STDERR(3), CURLOPT_DEBUGFUNCTION(3), CURLOPT_URL(3),
52
53
54
55libcurl 7.82.0                 November 26, 2021         CURLOPT_PATH_AS_IS(3)
Impressum