summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Casarin <jb55@jb55.com>2021-11-15 10:25:30 -0800
committerDrew DeVault <sir@cmpwn.com>2021-11-15 21:07:23 +0100
commit1925bc3e7a131dfcb1c6152c80675deb2a067020 (patch)
treeaa1ba50c4f5350eb5da434ddb829e1edf7317e54
parent57835017523fbd269594bb63c2628017e11eb423 (diff)
downloadgmnisrv-1925bc3e7a131dfcb1c6152c80675deb2a067020.tar.gz
gmnisrv-1925bc3e7a131dfcb1c6152c80675deb2a067020.tar.xz
gmnisrv-1925bc3e7a131dfcb1c6152c80675deb2a067020.zip
serve: make hostname matching case-insensitive
Reported-by: James Tomasino <james@tomasino.org> Signed-off-by: William Casarin <jb55@jb55.com>
-rw-r--r--src/serve.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/serve.c b/src/serve.c
index bcbef5c..683e8fa 100644
--- a/src/serve.c
+++ b/src/serve.c
@@ -8,6 +8,7 @@
#include <signal.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@@ -637,7 +638,7 @@ request_validate(struct gmnisrv_client *client, char **path)
client_submit_response(client,
GEMINI_STATUS_BAD_REQUEST, error, NULL);
goto exit;
- } else if (strcmp(part, client->host->hostname) != 0) {
+ } else if (strcasecmp(part, client->host->hostname) != 0) {
free(part);
const char *error = "Protocol error: hostname does not match SNI";
client_submit_response(client,