According RFC 4266 a gopher:// URL is:
[...]
A Gopher URL takes the form:
gopher://<host>:<port>/<gopher-path>
where is one of:
<gophertype><selector>
<gophertype><selector>%09<search>
<gophertype><selector>%09<search>%09<gopher+_string>
[...]
is the Gopher selector string. In the Gopher protocol,
Gopher selector strings are a sequence of octets that may contain any
octets except 09 hexadecimal (US-ASCII HT or tab), 0A hexadecimal
(US-ASCII character LF), and 0D (US-ASCII character CR).
[...]
However, everything after a `?' is ignored.
I did this
I will denote with a S> the server, and C> the client:
S> % nc -l 7070
C> % curl 'gopher://localhost:7070/1/foo?bar'
S> /foo
S> % nc -l 7070
C> % curl 'gopher://localhost:7070/1/foo?'
S> /foo
I expected the following
S> % nc -l 7070
C> % curl 'gopher://localhost:7070/1/foo?bar'
S> /foo?bar
S> % nc -l 7070
C> % curl 'gopher://localhost:7070/1/foo?'
S> /foo?
No ? and (if any) no octets after the ? should be omitted.
curl/libcurl version
% curl -V
curl 7.63.0 (x86_64--netbsd) libcurl/7.63.0 OpenSSL/1.1.0i zlib/1.2.10 libidn2/2.0.5
Release-Date: 2018-12-12
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy
operating system
NetBSD
PS: Please note that AFAICS we have no way to distunguish between a:
gopher://host:port/path and gopher://host:port/path? and so I think
that gopher_do() in lib/gopher.c could not be adjusted to just take
the concatenation of data->state.up.path and data->state.up.query
(in both cases data->state.up.query seems NULL).
Of course, if you have any idea how to better implement that,
feel free to share it and I'll try to write a possible patch!
Thank you very much!
According RFC 4266 a
gopher://URL is:However, everything after a `?' is ignored.
I did this
I will denote with a
S>the server, andC>the client:I expected the following
No
?and (if any) no octets after the?should be omitted.curl/libcurl version
operating system
NetBSD
PS: Please note that AFAICS we have no way to distunguish between a:
gopher://host:port/pathandgopher://host:port/path?and so I thinkthat
gopher_do()inlib/gopher.ccould not be adjusted to just takethe concatenation of
data->state.up.pathanddata->state.up.query(in both cases
data->state.up.queryseems NULL).Of course, if you have any idea how to better implement that,
feel free to share it and I'll try to write a possible patch!
Thank you very much!