~julienxx/castor

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Finish URLs in Gopher with \r\n

Niklas Sombert
Details
Message ID
<20200503101717.20781-1-niklas@ytvwld.de>
DKIM signature
missing
Download raw message
Patch: +2 -2
Using just \n may work with some servers but not with all.
Also, RFC 1436 describes the usage with CRLF.
---
 src/gopher/client.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gopher/client.rs b/src/gopher/client.rs
index bc5cf9d..1b65809 100644
--- a/src/gopher/client.rs
+++ b/src/gopher/client.rs
@@ -26,8 +26,8 @@ pub fn get_data<T: Protocol>(url: T) -> Result<(Option<Vec<u8>>, Vec<u8>), Strin
                let path = url.path().to_string();

                let mut url = match url.query() {
                    Some(query) => format!("{}?{}\n", path, query),
                    None => format!("{}\n", path),
                    Some(query) => format!("{}?{}\r\n", path, query),
                    None => format!("{}\r\n", path),
                };

                let url = if url.starts_with("/0") || url.starts_with("/1") || url.starts_with("/g")
-- 
2.17.1
Details
Message ID
<b9a83de5-2ed6-b73c-0bee-5dd5bbe2d506@typed-hole.org>
In-Reply-To
<20200503101717.20781-1-niklas@ytvwld.de> (view parent)
DKIM signature
pass
Download raw message
Thanks for the patch!
Review patch Export thread (mbox)