Added test 1613 to verify.
Closes #6490
curl_url_cleanup(h);
- /* url */
- result = Curl_dyn_add(r, url);
+ /* target or url */
+ result = Curl_dyn_add(r, data->set.str[STRING_TARGET]?
+ data->set.str[STRING_TARGET]:url);
free(url);
if(result)
return (result);
test1590 test1591 test1592 test1593 test1594 test1595 test1596 \
\
test1600 test1601 test1602 test1603 test1604 test1605 test1606 test1607 \
-test1608 test1609 test1610 test1611 test1612 \
+test1608 test1609 test1610 test1611 test1612 test1613 \
\
test1620 test1621 \
\
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+--request-target
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data>
+HTTP/1.1 200 OK\r
+Date: Sat, 29 Feb 2020 16:10:44 GMT\r
+Server: Blafasel/1.1\r
+Last-Modified: Sat, 29 Feb 2020 16:10:44 GMT\r
+Content-Length: 0\r
+Connection: close\r
+Content-Type: text/html\r
+\r
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+Send "OPTIONS *" with --request-target to a proxy
+</name>
+<features>
+proxy
+</features>
+<command>
+--request-target '*' -X OPTIONS --proxy http://%HOSTIP:%HTTPPORT/ -H "Testno: 1613" http://www.example.org/
+</command>
+</client>
+
+<verify>
+<protocol>
+OPTIONS * HTTP/1.1\r
+Host: www.example.org\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+Proxy-Connection: Keep-Alive\r
+Testno: 1613\r
+\r
+</protocol>
+</verify>
+</testcase>