From e0bb258de0563e34681b8f765fa2fad1a7cd92d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josip=20Ti=C5=A1ljar=20Matau=C5=A1i=C4=87?= Date: Fri, 22 May 2026 11:04:00 +0200 Subject: [PATCH 1/2] [fix] Disable separate selector characters for PDF and XML Lagrange does not recocnise 'P' and 'X' types as links. --- gopherType.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gopherType.go b/gopherType.go index 884502c..c6cd686 100644 --- a/gopherType.go +++ b/gopherType.go @@ -90,14 +90,8 @@ func (params *GopherTypeCharParams) GopherTypeChar(path string, isDir bool) stri return "I" case strings.HasPrefix(mimeType, "audio/"): return "s" - case mimeType == "application/pdf": - return "P" case strings.HasPrefix(mimeType, "text/html"): return "h" - case strings.HasPrefix(mimeType, "text/rtf"): - return "r" - case strings.HasPrefix(mimeType, "text/xml") || strings.HasPrefix(mimeType, "application/xml"): - return "X" default: return "9" } -- 2.47.3 From aecd851d6586b3fe3cad1a78af59cd034009d411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josip=20Ti=C5=A1ljar=20Matau=C5=A1i=C4=87?= Date: Fri, 22 May 2026 11:18:54 +0200 Subject: [PATCH 2/2] Add a note about server behaviour expectations --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f710751..acf588b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,21 @@ +> **Note** +> +> This program expects that your Gopher server treats **empty lines** as **information lines**. +> +> It also expects the server to **add the hostname** and the **port** number at the end of links. ### Compiling -This program compiles like any other ordinary Go project, simply **run** `go build .` in the project directory. +You need to have Go toolchain installed: +```shell +# Debian +sudo apt install golang + +# Fedora +sudo dnf install golang +``` + +Then, just **clone the repo** and run **`go build .`** to compile an executable. ### Usage ```shell -- 2.47.3