1
0
mirror of https://github.com/moparisthebest/curl synced 2025-01-11 05:58:01 -05: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:
Leonardo Taccari 2018-08-23 23:27:34 +02:00 committed by Daniel Stenberg
parent 387e85efd0
commit 8f3c3cd08a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 1 additions and 8 deletions

View File

@ -93,18 +93,11 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
}
else {
char *newp;
size_t j, i;
/* Otherwise, drop / and the first character (i.e., item type) ... */
newp = path;
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 */
result = Curl_urldecode(data, newp, 0, &sel, &len, FALSE);
if(result)

View File

@ -26,7 +26,7 @@ gopher
Gopher query
</name>
<command>
"gopher://%HOSTIP:%GOPHERPORT/7/the/search/engine?query%20succeeded/1202"
"gopher://%HOSTIP:%GOPHERPORT/7/the/search/engine%09query%20succeeded/1202"
</command>
</client>