ZERO_NULL, /* readwrite */
PORT_DICT, /* defport */
CURLPROTO_DICT, /* protocol */
- PROTOPT_NONE /* flags */
+ PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */
};
static char *unescape_word(struct SessionHandle *data, const char *inputbuff)
ZERO_NULL, /* readwrite */
0, /* defport */
CURLPROTO_FILE, /* protocol */
- PROTOPT_NONETWORK /* flags */
+ PROTOPT_NONETWORK | PROTOPT_NOURLQUERY /* flags */
};
ZERO_NULL, /* readwrite */
PORT_FTP, /* defport */
CURLPROTO_FTP, /* protocol */
- PROTOPT_DUAL | PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD /* flags */
+ PROTOPT_DUAL | PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD
+ | PROTOPT_NOURLQUERY /* flags */
};
PORT_FTPS, /* defport */
CURLPROTO_FTP | CURLPROTO_FTPS, /* protocol */
PROTOPT_SSL | PROTOPT_DUAL | PROTOPT_CLOSEACTION |
- PROTOPT_NEEDSPWD /* flags */
+ PROTOPT_NEEDSPWD | PROTOPT_NOURLQUERY /* flags */
};
#endif
ZERO_NULL, /* readwrite */
PORT_IMAP, /* defport */
CURLPROTO_IMAP, /* protocol */
- PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD /* flags */
+ PROTOPT_CLOSEACTION | PROTOPT_NEEDSPWD
+ | PROTOPT_NOURLQUERY /* flags */
};
ZERO_NULL, /* readwrite */
PORT_IMAPS, /* defport */
CURLPROTO_IMAP | CURLPROTO_IMAPS, /* protocol */
- PROTOPT_CLOSEACTION | PROTOPT_SSL | PROTOPT_NEEDSPWD /* flags */
+ PROTOPT_CLOSEACTION | PROTOPT_SSL | PROTOPT_NEEDSPWD
+ | PROTOPT_NOURLQUERY /* flags */
};
#endif
ZERO_NULL, /* readwrite */
PORT_POP3, /* defport */
CURLPROTO_POP3, /* protocol */
- PROTOPT_CLOSEACTION /* flags */
+ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY /* flags */
};
ZERO_NULL, /* readwrite */
PORT_POP3S, /* defport */
CURLPROTO_POP3 | CURLPROTO_POP3S, /* protocol */
- PROTOPT_CLOSEACTION | PROTOPT_SSL /* flags */
+ PROTOPT_CLOSEACTION | PROTOPT_SSL
+ | PROTOPT_NOURLQUERY /* flags */
};
#endif
ZERO_NULL, /* readwrite */
PORT_SMTP, /* defport */
CURLPROTO_SMTP, /* protocol */
- PROTOPT_CLOSEACTION /* flags */
+ PROTOPT_CLOSEACTION | PROTOPT_NOURLQUERY /* flags */
};
#ifdef USE_SSL
ZERO_NULL, /* readwrite */
PORT_SMTPS, /* defport */
CURLPROTO_SMTP | CURLPROTO_SMTPS, /* protocol */
- PROTOPT_CLOSEACTION | PROTOPT_SSL /* flags */
+ PROTOPT_CLOSEACTION | PROTOPT_SSL
+ | PROTOPT_NOURLQUERY /* flags */
};
#endif
ZERO_NULL, /* readwrite */
PORT_SSH, /* defport */
CURLPROTO_SCP, /* protocol */
- PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION /* flags */
+ PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION
+ | PROTOPT_NOURLQUERY /* flags */
};
ZERO_NULL, /* readwrite */
PORT_SSH, /* defport */
CURLPROTO_SFTP, /* protocol */
- PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION /* flags */
+ PROTOPT_DIRLOCK | PROTOPT_CLOSEACTION
+ | PROTOPT_NOURLQUERY /* flags */
};
ZERO_NULL, /* readwrite */
PORT_TELNET, /* defport */
CURLPROTO_TELNET, /* protocol */
- PROTOPT_NONE /* flags */
+ PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */
};
ZERO_NULL, /* readwrite */
PORT_TFTP, /* defport */
CURLPROTO_TFTP, /* protocol */
- PROTOPT_NONE /* flags */
+ PROTOPT_NONE | PROTOPT_NOURLQUERY /* flags */
};
/**********************************************************
if(result != CURLE_OK)
return result;
+
+ /*************************************************************
+ * If the protocol can't handle url query strings, then cut
+ * of the unhandable part
+ *************************************************************/
+ if((conn->given->flags&PROTOPT_NOURLQUERY)) {
+ char *path_q_sep = strchr(conn->data->state.path, '?');
+ if(path_q_sep) {
+ /* according to rfc3986, allow the query (?foo=bar)
+ also on protocols that can't handle it.
+
+ cut the string-part after '?'
+ */
+
+ /* terminate the string */
+ path_q_sep[0] = 0;
+ }
+ }
+
#ifndef CURL_DISABLE_PROXY
/*************************************************************
* Extract the user and password from the authentication string
#define PROTOPT_NONETWORK (1<<4) /* protocol doesn't use the network! */
#define PROTOPT_NEEDSPWD (1<<5) /* needs a password, and if none is set it
gets a default */
+#define PROTOPT_NOURLQUERY (1<<6) /* protocol can't handle
+ url query strings (?foo=bar) ! */
/* return the count of bytes sent, or -1 on error */
test1126 test1127 test1128 test1129 test1130 test1131 \
test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \
test1208 test1209 test1210 \
+test1220 \
test1300 test1301 test1302 test1303 test1304 test1305 \
test1306 test1307 test1308 test1309 test1310 test1311 test1312 test1313 \
test1314 \
--- /dev/null
+<testcase>
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+file
+</server>
+ <name>
+file:// URLs with query string
+ </name>
+ <command>
+file://localhost/%PWD/log/test1220.txt?a_query=foobar#afragment
+</command>
+<file name="log/test1220.txt">
+contents in a single file
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<stdout>
+contents in a single file
+</stdout>
+</verify>
+</testcase>