Fix #1558 - add opts.extra_headers in 304 responses

This commit is contained in:
Sergey Lyubka committed 2022-05-30 17:44:26 +01:00
1 parent e2ce68e3ef
commit 65957527cb
3 files changed
+8 -2

No files matched your search

+2 -1
View File
@@ -451,7 +451,8 @@ void mg_http_serve_file(struct mg_connection *c, struct mg_http_message *hm,
(inm = mg_http_get_header(hm, "If-None-Match")) != NULL &&
mg_vcasecmp(inm, etag) == 0) {
mg_fs_close(fd);
mg_printf(c, "HTTP/1.1 304 Not Modified\r\nContent-Length: 0\r\n\r\n");
mg_printf(c, "HTTP/1.1 304 Not Modified\r\n%sContent-Length: 0\r\n\r\n",
opts->extra_headers ? opts->extra_headers : "");
} else {
int n, status = 200;
char range[100] = "";