query-part: ignore the URI part for given protocols

By setting PROTOPT_NOURLQUERY in the protocol handler struct, the
protocol will get the "query part" of the URL cut off before the data is
handled by the protocol-specific code. This makes libcurl adhere to
RFC3986 section 2.2.

Test 1220 is added to verify a file:// URL with query-part.
This commit is contained in:
Jonas Schnelli 2011-11-24 23:28:54 +01:00 committed by Daniel Stenberg
parent 4403e82f32
commit 2c905fd1f8
13 changed files with 73 additions and 14 deletions

View file

@ -171,7 +171,8 @@ const struct Curl_handler Curl_handler_scp = {
ZERO_NULL, /* readwrite */
PORT_SSH, /* defport */
CURLPROTO_SCP, /* protocol */
PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION /* flags */
PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION
| PROTOPT_NOURLQUERY /* flags */
};
@ -196,7 +197,8 @@ const struct Curl_handler Curl_handler_sftp = {
ZERO_NULL, /* readwrite */
PORT_SSH, /* defport */
CURLPROTO_SFTP, /* protocol */
PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION /* flags */
PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION
| PROTOPT_NOURLQUERY /* flags */
};