mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 20:49:01 -04:00
When returning a 405 append an Allow header as per rfc
This commit is contained in:
parent
634bb482d6
commit
cb17c0d610
@ -919,6 +919,9 @@ http_response_spdy(struct http_request *req, struct connection *c,
|
||||
KORE_VERSION_STATE);
|
||||
spdy_header_block_add(hblock, ":server", sbuf);
|
||||
|
||||
if (status == HTTP_STATUS_METHOD_NOT_ALLOWED)
|
||||
spdy_header_block_add(hblock, ":allow", "get, post");
|
||||
|
||||
if (http_hsts_enable) {
|
||||
snprintf(sbuf, sizeof(sbuf),
|
||||
"max-age=%" PRIu64, http_hsts_enable);
|
||||
@ -969,6 +972,9 @@ http_response_normal(struct http_request *req, struct connection *c,
|
||||
KORE_NAME_STRING, KORE_VERSION_MAJOR, KORE_VERSION_MINOR,
|
||||
KORE_VERSION_STATE);
|
||||
|
||||
if (status == HTTP_STATUS_METHOD_NOT_ALLOWED)
|
||||
kore_buf_appendf(buf, "Allow: GET, POST\r\n");
|
||||
|
||||
if (c->flags & CONN_CLOSE_EMPTY)
|
||||
connection_close = 1;
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user