Added test 425 to verify.
Reported-by: Dirk Rosenkranz
Bug: https://curl.se/mail/archive-2023-04/0008.html
Closes #10969
CURLUcode uerr;
CURLU *uh = curl_url();
char *path = NULL;
+ char *query = NULL;
if(uh) {
char *ptr;
uerr = curl_url_set(uh, CURLUPART_URL, *inurlp,
result = urlerr_cvt(uerr);
goto fail;
}
-
+ uerr = curl_url_get(uh, CURLUPART_QUERY, &query, 0);
+ if(query) {
+ curl_free(query);
+ curl_free(path);
+ curl_url_cleanup(uh);
+ return CURLE_OK;
+ }
ptr = strrchr(path, '/');
if(!ptr || !*++ptr) {
/* The URL path has no file name part, add the local file name. In order
test390 test391 test392 test393 test394 test395 test396 test397 test398 \
test399 test400 test401 test402 test403 test404 test405 test406 test407 \
test408 test409 test410 test411 test412 test413 test414 test415 test416 \
-test417 test418 test419 test420 test421 test422 test423 test424 \
+test417 test418 test419 test420 test421 test422 test423 test424 test425 \
\
test430 test431 test432 test433 test434 test435 test436 \
\
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data crlf="yes">
+HTTP/1.1 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP PUT with path ending with slash + query
+ </name>
+ <command>
+-T log/up%TESTNUMBER http://%HOSTIP:%HTTPPORT/%TESTNUMBER/?fullpath
+</command>
+<file name="log/up%TESTNUMBER">
+content
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+PUT /%TESTNUMBER/?fullpath HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+Content-Length: 8\r
+\r
+content
+</protocol>
+</verify>
+</testcase>