CURLOPT_PATH_AS_IS.3 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PATH_AS_IS.md
  2. .TH CURLOPT_PATH_AS_IS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PATH_AS_IS \- do not handle dot dot sequences
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PATH_AS_IS, long leaveit);
  9. .fi
  10. .SH DESCRIPTION
  11. Set the long \fIleaveit\fP to 1, to explicitly tell libcurl to not alter the
  12. given path before passing it on to the server.
  13. This instructs libcurl to NOT squash sequences of "/../" or "/./" that may
  14. exist in the URL\(aqs path part and that is supposed to be removed according to
  15. RFC 3986 section 5.2.4.
  16. Some server implementations are known to (erroneously) require the dot dot
  17. sequences to remain in the path and some clients want to pass these on in
  18. order to try out server implementations.
  19. By default libcurl normalizes such sequences before using the path.
  20. The corresponding flag for the \fIcurl_url_set(3)\fP function is called
  21. \fBCURLU_PATH_AS_IS\fP.
  22. .SH DEFAULT
  23. 0
  24. .SH PROTOCOLS
  25. This functionality affects all supported protocols
  26. .SH EXAMPLE
  27. .nf
  28. int main(void)
  29. {
  30. CURL *curl = curl_easy_init();
  31. if(curl) {
  32. curl_easy_setopt(curl, CURLOPT_URL,
  33. "https://example.com/../../etc/password");
  34. curl_easy_setopt(curl, CURLOPT_PATH_AS_IS, 1L);
  35. curl_easy_perform(curl);
  36. }
  37. }
  38. .fi
  39. .SH AVAILABILITY
  40. Added in curl 7.42.0
  41. .SH RETURN VALUE
  42. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  43. .SH SEE ALSO
  44. .BR CURLOPT_DEBUGFUNCTION (3),
  45. .BR CURLOPT_STDERR (3),
  46. .BR CURLOPT_URL (3),
  47. .BR curl_url_set (3)