mirror of https://git.kore.io/kore.git
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);
|
KORE_VERSION_STATE);
|
||||||
spdy_header_block_add(hblock, ":server", sbuf);
|
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) {
|
if (http_hsts_enable) {
|
||||||
snprintf(sbuf, sizeof(sbuf),
|
snprintf(sbuf, sizeof(sbuf),
|
||||||
"max-age=%" PRIu64, http_hsts_enable);
|
"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_NAME_STRING, KORE_VERSION_MAJOR, KORE_VERSION_MINOR,
|
||||||
KORE_VERSION_STATE);
|
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)
|
if (c->flags & CONN_CLOSE_EMPTY)
|
||||||
connection_close = 1;
|
connection_close = 1;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue