mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-27 12:35:26 +00:00
makefsdata: error files must start with "<errnr>." 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 <goldsimon@gmx.de>
This commit is contained in:
parent
0f5bf0aa37
commit
75b2db4438
@ -1069,17 +1069,17 @@ int file_write_http_header(FILE *data_file, const char *filename, int file_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(data_file, NEWLINE "/* HTTP header */");
|
fprintf(data_file, NEWLINE "/* HTTP header */");
|
||||||
if (strstr(filename, "404") == filename) {
|
if (strstr(filename, "404.") == filename) {
|
||||||
response_type = HTTP_HDR_NOT_FOUND;
|
response_type = HTTP_HDR_NOT_FOUND;
|
||||||
if (useHttp11) {
|
if (useHttp11) {
|
||||||
response_type = HTTP_HDR_NOT_FOUND_11;
|
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;
|
response_type = HTTP_HDR_BAD_REQUEST;
|
||||||
if (useHttp11) {
|
if (useHttp11) {
|
||||||
response_type = HTTP_HDR_BAD_REQUEST_11;
|
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;
|
response_type = HTTP_HDR_NOT_IMPL;
|
||||||
if (useHttp11) {
|
if (useHttp11) {
|
||||||
response_type = HTTP_HDR_NOT_IMPL_11;
|
response_type = HTTP_HDR_NOT_IMPL_11;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user