mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Remove unnecessary headers from 304 reply.
This commit is contained in:
parent
a2eb59e928
commit
a0c87d39a2
12
darkhttpd.c
12
darkhttpd.c
@ -1795,8 +1795,18 @@ static void process_get(struct connection *conn) {
|
||||
(strcmp(if_mod_since, lastmod) == 0)) {
|
||||
if (debug)
|
||||
printf("not modified since %s\n", if_mod_since);
|
||||
default_reply(conn, 304, "Not Modified", "");
|
||||
conn->http_code = 304;
|
||||
conn->header_length = xasprintf(&(conn->header),
|
||||
"HTTP/1.1 304 Not Modified\r\n"
|
||||
"Date: %s\r\n"
|
||||
"Server: %s\r\n"
|
||||
"%s" /* keep-alive */
|
||||
"\r\n",
|
||||
rfc1123_date(date, now), pkgname, keep_alive(conn));
|
||||
conn->reply_length = 0;
|
||||
conn->reply_type = REPLY_GENERATED;
|
||||
conn->header_only = 1;
|
||||
|
||||
free(if_mod_since);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user