mirror of
https://github.com/curl/curl.git
synced 2025-09-18 01:52:41 +03:00
gopher: Do not translate ?' to
%09'
Since GOPHER support was added in curl `?' character was automatically translated to `%09' (`\t'). However, this behaviour does not seems documented in RFC 4266 and for search selectors it is documented to directly use `%09' in the URL. Apart that several gopher servers in the current gopherspace have CGI support where `?' is used as part of the selector and translating it to `%09' often leads to surprising results. Closes #2910
This commit is contained in:
parent
387e85efd0
commit
8f3c3cd08a
|
@ -93,18 +93,11 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *newp;
|
char *newp;
|
||||||
size_t j, i;
|
|
||||||
|
|
||||||
/* Otherwise, drop / and the first character (i.e., item type) ... */
|
/* Otherwise, drop / and the first character (i.e., item type) ... */
|
||||||
newp = path;
|
newp = path;
|
||||||
newp += 2;
|
newp += 2;
|
||||||
|
|
||||||
/* ... then turn ? into TAB for search servers, Veronica, etc. ... */
|
|
||||||
j = strlen(newp);
|
|
||||||
for(i = 0; i<j; i++)
|
|
||||||
if(newp[i] == '?')
|
|
||||||
newp[i] = '\x09';
|
|
||||||
|
|
||||||
/* ... and finally unescape */
|
/* ... and finally unescape */
|
||||||
result = Curl_urldecode(data, newp, 0, &sel, &len, FALSE);
|
result = Curl_urldecode(data, newp, 0, &sel, &len, FALSE);
|
||||||
if(result)
|
if(result)
|
||||||
|
|
|
@ -26,7 +26,7 @@ gopher
|
||||||
Gopher query
|
Gopher query
|
||||||
</name>
|
</name>
|
||||||
<command>
|
<command>
|
||||||
"gopher://%HOSTIP:%GOPHERPORT/7/the/search/engine?query%20succeeded/1202"
|
"gopher://%HOSTIP:%GOPHERPORT/7/the/search/engine%09query%20succeeded/1202"
|
||||||
</command>
|
</command>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user