From 34ef03a43c4e9038ad373ebac1b9b0088de1d8b8 Mon Sep 17 00:00:00 2001 From: MatthiasSaihttam Date: Mon, 15 Nov 2021 10:44:52 -0500 Subject: [PATCH] Make hostname matching case insensitive --- GeminiServer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GeminiServer.js b/GeminiServer.js index 75fe73d..bf79ff2 100644 --- a/GeminiServer.js +++ b/GeminiServer.js @@ -17,10 +17,10 @@ function wildHostMatches(wildHost, hostInstance) { if (wildHost[0] === "*") { //Return if everything after the first . matches //TODO: what happens if I'm dumb and enter *ww.example.com - return wildHost.slice(wildHost.indexOf(".")) === hostInstance.slice(hostInstance.indexOf(".")) + return wildHost.toLowerCase().slice(wildHost.indexOf(".")) === hostInstance.toLowerCase().slice(hostInstance.indexOf(".")) }else { //If there's no wildcard, just return if they match - return wildHost === hostInstance; + return wildHost.toLowerCase() === hostInstance.toLowerCase(); } }