From 75b2db44382f2ef68fea1749b9fc5e6cca2e940d Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 30 Jan 2020 21:22:36 +0100 Subject: [PATCH] makefsdata: error files must start with "." to match HTTP status This is to prevent files like "4001.jpg" getting HTTP status 400 instead of 100. See bug #56290. Signed-off-by: Simon Goldschmidt --- src/apps/http/makefsdata/makefsdata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/http/makefsdata/makefsdata.c b/src/apps/http/makefsdata/makefsdata.c index 7c38e223..27dba95f 100644 --- a/src/apps/http/makefsdata/makefsdata.c +++ b/src/apps/http/makefsdata/makefsdata.c @@ -1069,17 +1069,17 @@ int file_write_http_header(FILE *data_file, const char *filename, int file_size, } fprintf(data_file, NEWLINE "/* HTTP header */"); - if (strstr(filename, "404") == filename) { + if (strstr(filename, "404.") == filename) { response_type = HTTP_HDR_NOT_FOUND; if (useHttp11) { response_type = HTTP_HDR_NOT_FOUND_11; } - } else if (strstr(filename, "400") == filename) { + } else if (strstr(filename, "400.") == filename) { response_type = HTTP_HDR_BAD_REQUEST; if (useHttp11) { response_type = HTTP_HDR_BAD_REQUEST_11; } - } else if (strstr(filename, "501") == filename) { + } else if (strstr(filename, "501.") == filename) { response_type = HTTP_HDR_NOT_IMPL; if (useHttp11) { response_type = HTTP_HDR_NOT_IMPL_11;