limit filemaps to HEAD/GET requests.

This commit is contained in:
Joris Vink 2018-06-28 14:24:02 +02:00
parent d876e41ebb
commit f2c87fd130
1 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,13 @@ filemap_resolve(struct http_request *req)
size_t best_len;
struct filemap_entry *entry, *best;
if (req->method != HTTP_METHOD_GET &&
req->method != HTTP_METHOD_HEAD) {
http_response_header(req, "allow", "get, head");
http_response(req, HTTP_STATUS_BAD_REQUEST, NULL, 0);
return (KORE_RESULT_OK);
}
best = NULL;
best_len = 0;