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 <goldsimon@gmx.de>
This commit is contained in:
goldsimon 2018-02-03 21:51:33 +01:00
parent d5d30d49f2
commit 053a5e6e13

View File

@ -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) {