HTTP proxy: insert slash in URL if missing
authorDaniel Stenberg <daniel@haxx.se>
Fri, 15 Mar 2013 13:18:16 +0000 (14:18 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 15 Mar 2013 13:18:16 +0000 (14:18 +0100)
commite4b733e3f1a771bd1017cdcfb355fcb9caffe646
tree862fa85997d33e26f9e30b7949cbddfb6ad8f91a
parentb50285d751855440252904c76995b6de193c2dc2
HTTP proxy: insert slash in URL if missing

curl has been accepting URLs using slightly wrong syntax for a long
time, such as when completely missing as slash "http://example.org" or
missing a slash when a query part is given
"http://example.org?q=foobar".

curl would translate these into a legitimate HTTP request to servers,
although as was shown in bug #1206 it was not adjusted properly in the
cases where a HTTP proxy was used.

Test 1213 and 1214 were added to the test suite to verify this fix.

The test HTTP server was adjusted to allow us to specify test number in
the host name only without using any slashes in a given URL.

Bug: http://curl.haxx.se/bug/view.cgi?id=1206
Reported by: ScottJi
lib/url.c
tests/FILEFORMAT
tests/data/Makefile.am
tests/data/test1213 [new file with mode: 0644]
tests/data/test1214 [new file with mode: 0644]
tests/server/sws.c