-- Leo's gemini proxy

-- Connecting to typed-hole.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

commit 445df0dfabd2c565e3e534a2224c0caee2263150

Author: Niklas Sombert <niklas@ytvwld.de>

Date: Sun May 3 12:17:17 2020 +0200


Finish URLs in Gopher with \r\n


Using just \n may work with some servers but not with all.

Also, RFC 1436 describes the usage with CRLF.


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")



---

Served by Pollux Gemini Server.

-- Response ended

-- Page fetched on Sun May 19 07:56:29 2024