Browse Source

[core] respond 411 Length Required if request has Transfer-Encoding: chunked (fixes #631)

lighttpd does not currently support request body transfer-codings

From: Glenn Strauss <gstrauss@gluelogic.com>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3128 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/heads/lighttpd-1.4.x
Glenn Strauss 6 years ago
committed by Stefan Bühler
parent
commit
06d3c75440
  1. 1
      NEWS
  2. 10
      src/request.c

1
NEWS

@ -52,6 +52,7 @@ NEWS
* [config] warn if server.upload-dirs has non-existent dirs (fixes #2508)
* [mod_proxy] accept LF delimited headers, not just CRLF (fixes #2594)
* [core] wait for grandchild to be ready when daemonizing (fixes #2712, thx pasdVn)
* [core] respond 411 Length Required if request has Transfer-Encoding: chunked (fixes #631)
- 1.4.39 - 2016-01-02
* [core] fix memset_s call (fixes #2698)

10
src/request.c

@ -1133,7 +1133,15 @@ int http_request_parse(server *srv, connection *con) {
}
break;
default:
/* the may have a content-length */
/* require Content-Length if request contains request body */
if (array_get_element(con->request.headers, "Transfer-Encoding")) {
/* presence of Transfer-Encoding in request headers requires "chunked"
* be final encoding in HTTP/1.1. Return 411 Length Required as
* lighttpd does not support request input transfer-encodings */
con->keep_alive = 0;
con->http_status = 411; /* 411 Length Required */
return 0;
}
break;
}

Loading…
Cancel
Save