commit f2c87fd130671e7533682f3b1b4866a1df7c94ee
parent d876e41ebbd33af5ce4c08f7ea2378c6f97fc3ba
Author: Joris Vink <joris@coders.se>
Date: Thu, 28 Jun 2018 14:24:02 +0200
limit filemaps to HEAD/GET requests.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/filemap.c b/src/filemap.c
@@ -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;