From 95aa2c178d6d61e1e42c99018d79993c66bc46e6 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 25 Mar 2019 22:37:31 -0400 Subject: [PATCH] [core] 200 for OPTIONS /non-existent/path HTTP/1.1 (fixes #2939) 200 for OPTIONS /non-existent/path HTTP/1.1 when a module, such as mod_webdav, has set Allow response header x-ref: "OPTIONS should return 2xx status for non-existent resources if Allow is set" https://redmine.lighttpd.net/issues/2939 --- src/response.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/response.c b/src/response.c index c4a541fb..173e1859 100644 --- a/src/response.c +++ b/src/response.c @@ -138,6 +138,12 @@ static handler_t http_response_physical_path_check(server *srv, connection *con) case ENAMETOOLONG: /* file name to be read was too long. return 404 */ case ENOENT: + if (con->request.http_method == HTTP_METHOD_OPTIONS + && NULL != http_header_response_get(con, HTTP_HEADER_OTHER, CONST_STR_LEN("Allow"))) { + con->http_status = 200; + return HANDLER_FINISHED; + } + con->http_status = 404; if (con->conf.log_request_handling) {