From 44af303de6b69a3bb126b1c6c031a889a0a122e1 Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Tue, 30 Jun 2020 19:11:49 +0200 Subject: [PATCH] Fix silly mistake in hasty port checking fix. --- handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handler.go b/handler.go index 3353193..acec76a 100644 --- a/handler.go +++ b/handler.go @@ -15,6 +15,7 @@ import ( "path/filepath" "regexp" "sort" + "strconv" "strings" "time" ) @@ -60,7 +61,7 @@ func handleGeminiRequest(conn net.Conn, config Config, accessLogEntries chan Log } // Reject requests for content from other servers - if URL.Hostname() != config.Hostname || (URL.Port() != "" && URL.Port() != config.Port) { + if URL.Hostname() != config.Hostname || (URL.Port() != "" && URL.Port() != strconv.Itoa(config.Port)) { conn.Write([]byte("53 No proxying to other hosts or ports!\r\n")) log.Status = 53 return