From 053a5e6e134236d45128e6b4308e82d1dbcfea2c Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sat, 3 Feb 2018 21:51:33 +0100 Subject: [PATCH] httpd: get_http_headers: fix content length check for custom files Headers are never included here or else get_http_headers would not have been called. As a result, custom files need to set FS_FILE_FLAGS_HEADER_PERSISTENT in file->flags if file->len is the correct length of the file. See also patch #9500 Signed-off-by: goldsimon --- src/apps/httpd/httpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c index f0992854..aca6d3b1 100644 --- a/src/apps/httpd/httpd.c +++ b/src/apps/httpd/httpd.c @@ -937,7 +937,7 @@ get_http_headers(struct http_state *hs, const char *uri) } else #endif /* LWIP_HTTPD_SSI */ if ((hs->handle == NULL) || - ((hs->handle->flags & (FS_FILE_FLAGS_HEADER_INCLUDED | FS_FILE_FLAGS_HEADER_PERSISTENT)) == FS_FILE_FLAGS_HEADER_INCLUDED)) { + ((hs->handle->flags & FS_FILE_FLAGS_HEADER_PERSISTENT) == 0)) { add_content_len = 0; } if (add_content_len) {