Missing options for HTTP method restrictions.

While Kore supports the OPTIONS method, it was not possible
to specify this in the route methods configuration.

Pointed out via discord.
This commit is contained in:
Joris Vink 2023-12-01 00:33:18 +01:00
parent 4df120704d
commit f47f8d3f5e
1 changed files with 2 additions and 0 deletions

View File

@ -1255,6 +1255,8 @@ configure_route_methods(char *options)
current_route->methods |= HTTP_METHOD_HEAD;
} else if (!strcasecmp(argv[i], "patch")) {
current_route->methods |= HTTP_METHOD_PATCH;
} else if (!strcasecmp(argv[i], "options")) {
current_route->methods |= HTTP_METHOD_OPTIONS;
} else {
kore_log(LOG_ERR, "unknown method: %s in method for %s",
argv[i], current_route->path);