Browse Source

[core] return 501 Not Implemented in static file mode for all methods except GET/POST/HEAD/OPTIONS

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2882 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.33
Stefan Bühler 9 years ago
parent
commit
9b36534752
  1. 1
      NEWS
  2. 20
      src/connections.c
  3. 2
      src/request.c

1
NEWS

@ -19,6 +19,7 @@ NEWS
* [mod_auth] fix invalid read in digest qop=auth-int handling (fixes #2478)
* [auto* build] simplify autogen.sh, handle automake 1.13 test running (fixes #2490)
* [mod_userdir] add userdir.active option, "enabled" by default
* [core] return 501 Not Implemented in static file mode for all methods except GET/POST/HEAD/OPTIONS
- 1.4.32 - 2012-11-21
* Code cleanup with clang/sparse (fixes #2437, thx kibi)

20
src/connections.c

@ -419,16 +419,6 @@ static int connection_handle_write_prepare(server *srv, connection *con) {
case HTTP_METHOD_GET:
case HTTP_METHOD_POST:
case HTTP_METHOD_HEAD:
case HTTP_METHOD_PUT:
case HTTP_METHOD_PATCH:
case HTTP_METHOD_MKCOL:
case HTTP_METHOD_DELETE:
case HTTP_METHOD_COPY:
case HTTP_METHOD_MOVE:
case HTTP_METHOD_PROPFIND:
case HTTP_METHOD_PROPPATCH:
case HTTP_METHOD_LOCK:
case HTTP_METHOD_UNLOCK:
break;
case HTTP_METHOD_OPTIONS:
/*
@ -450,16 +440,8 @@ static int connection_handle_write_prepare(server *srv, connection *con) {
}
break;
default:
switch(con->http_status) {
case 400: /* bad request */
case 401: /* authorization required */
case 414: /* overload request header */
case 505: /* unknown protocol */
case 207: /* this was webdav */
break;
default:
if (0 == con->http_status) {
con->http_status = 501;
break;
}
break;
}

2
src/request.c

@ -366,7 +366,7 @@ int http_request_parse(server *srv, connection *con) {
*(proto - 1) = '\0';
/* we got the first one :) */
if (-1 == (r = get_http_method_key(method))) {
if (HTTP_METHOD_UNSET == (r = get_http_method_key(method))) {
con->http_status = 501;
con->response.keep_alive = 0;
con->keep_alive = 0;

Loading…
Cancel
Save