From 47f09c3ce2f91d8de4f26b717f4eb89628db9f09 Mon Sep 17 00:00:00 2001 From: Nate Choe Date: Thu, 25 Jan 2024 22:54:20 -0600 Subject: [PATCH] Change default Accept to */* to conform to RFC 9112 --- src/responses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/responses.c b/src/responses.c index ce5ad21..defd5ff 100644 --- a/src/responses.c +++ b/src/responses.c @@ -342,7 +342,7 @@ static int sendCertainResponse(Connection *conn, Sitefile *site, int index) { int sendResponse(Connection *conn, Sitefile *site) { char *host = NULL; - char *accept = NULL; + char *accept = "*/*"; int i; for (i = 0; i < conn->fieldCount; i++) { if (strcmp(conn->fields[i].field, "Host") == 0) @@ -350,7 +350,7 @@ int sendResponse(Connection *conn, Sitefile *site) { else if (strcmp(conn->fields[i].field, "Accept") == 0) accept = conn->fields[i].value; } - if (host == NULL || accept == NULL) { + if (host == NULL) { sendErrorResponse(conn->stream, ERROR_400); return 1; }