diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-12-18 09:19:10 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-12-18 09:19:10 +0000 |
commit | 6c6e5522cb8daf2458aa13e36ab98de62c8982b9 (patch) | |
tree | 697717df11e3d5e8826a34a88b1d7dcf6d6f151c /lib | |
parent | aff9a817b4b970c06b810c88383efce4400d1e0b (diff) |
redirect from a bad url such as "www.com?moo=foo" to an absolute path didn't
work, as reported by John McGowan
Diffstat (limited to 'lib')
-rw-r--r-- | lib/transfer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 56cc46cfa..74f03611b 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1666,6 +1666,15 @@ CURLcode Curl_follow(struct SessionHandle *data, pathsep = strchr(protsep, '/'); if(pathsep) *pathsep=0; + else { + /* There was no slash. Now, since we might be operating on a badly + formatted URL, such as "http://www.url.com?id=2380" which doesn't + use a slash separator as it is supposed to, we need to check for a + ?-letter as well! */ + pathsep = strchr(protsep, '?'); + if(pathsep) + *pathsep=0; + } } /* If the new part contains a space, this is a mighty stupid redirect |