Browse Source

- fix the frigging 404-handler bugs:

- dont restore the http status code unconditionally (1270)
  - mod_staticfile should set the http status properly. otherwise we run into
    the 404 handling twice and it appends the default 404 page to the content.
  (this passed the testsuite)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1899 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.17
Marcus Rückert 15 years ago
parent
commit
5504501699
  1. 4
      src/connections.c
  2. 1
      src/mod_staticfile.c

4
src/connections.c

@ -1445,7 +1445,9 @@ int connection_state_machine(server *srv, connection *con) {
} else if (con->in_error_handler) {
/* error-handler is back and has generated content */
/* if Status: was set, take it otherwise use 200 */
con->http_status = con->error_handler_saved_status;
if (con->http_status == 0) {
con->http_status = con->error_handler_saved_status;
}
}
if (con->http_status == 0) con->http_status = 200;

1
src/mod_staticfile.c

@ -506,6 +506,7 @@ URIHANDLER_FUNC(mod_staticfile_subrequest) {
*/
http_chunk_append_file(srv, con, con->physical.path, 0, sce->st.st_size);
con->http_status = 200;
con->file_finished = 1;
return HANDLER_FINISHED;

Loading…
Cancel
Save