forked from aniani/gmnisrv
1
0
Fork 0

serve: make hostname matching case-insensitive

Reported-by: James Tomasino <james@tomasino.org>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2021-11-15 10:25:30 -08:00 committed by Drew DeVault
parent 5783501752
commit 1925bc3e7a
1 changed files with 2 additions and 1 deletions

View File

@ -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,