GNURLOPT_PATH_AS_IS(3)
π GNURLOPT_PATH_AS_IS(3) π
okay so bestie, this page lives in the curl_easy_setopt options manual, and it's all about one very specific little switch: CURLOPT_PATH_AS_IS. stay with me, it's actually iconic.
β¨ NAME β¨
CURLOPT_PATH_AS_IS β do not handle dot dot sequences
π¦ SYNOPSIS π¦
okay so the synopsis is literally:
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PATH_AS_IS, long
leaveit);
π DESCRIPTION π
Set that long leaveit to 1, and you're explicitly telling libcurl to not alter the given path before passing it on to the server. like, hands off the path, okay?
This instructs libcurl to NOT squash sequences of /../ or /./ that may exist in the URL's path part and that is supposed to be removed according to RFC 3986 section 5.2.4.
Some server implementations are known to (erroneously) require the dot dot sequences to remain in the path, and some clients want to pass these on in order to try out server implementations. iykyk β this option is for exactly those situations.
By default libcurl will merge such sequences before using the path.
π DEFAULT π
0
so if you do nothing, libcurl does its normal merge-y thing. no cap.
π PROTOCOLS π
All
every protocol, bestie β¨
π EXAMPLE π
Here's the example, bestie β copy it exactly:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/../../etc/password");
curl_easy_setopt(curl, CURLOPT_PATH_AS_IS, 1L);
curl_easy_perform(curl);
}
β AVAILABILITY β
Added in 7.42.0. periodt.
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
π«Ά SEE ALSO π«Ά
go read these too:
that's the whole page, bestie β signing off from libcurl 7.42.0, dated 17 Jun 2014, and this iconic page is GNURLOPT_PATH_AS_IS(3) πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms