When returning a 405 append an Allow header as per rfc

This commit is contained in:
Joris Vink 2014-02-27 22:24:28 +01:00
parent 634bb482d6
commit cb17c0d610
1 changed files with 6 additions and 0 deletions

View File

@ -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