Browse Source

fix sending "408 - Timeout" instead of "410 - Gone" for timedout urls in mod_secdownload (#1440)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2111 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.19
Stefan Bühler 14 years ago
parent
commit
52840fa1ed
  1. 1
      NEWS
  2. 3
      src/mod_secure_download.c
  3. 4
      tests/mod-secdownload.t

1
NEWS

@ -47,6 +47,7 @@ NEWS
* spawn-fcgi: only try to connect to unix socket (not tcp) before spawning (#1575)
* fix sending source of cgi script instead of 500 error if fork fails
* fix min-procs handling in mod_scgi.c, just set to max-procs (patch from #623)
* fix sending "408 - Timeout" instead of "410 - Gone" for timedout urls in mod_secdownload (#1440)
- 1.4.18 - 2007-09-09

3
src/mod_secure_download.c

@ -245,7 +245,8 @@ URIHANDLER_FUNC(mod_secdownload_uri_handler) {
/* timed-out */
if (srv->cur_ts - ts > p->conf.timeout ||
srv->cur_ts - ts < -p->conf.timeout) {
con->http_status = 408;
/* "Gone" as the url will never be valid again instead of "408 - Timeout" where the request may be repeated */
con->http_status = 410;
return HANDLER_FINISHED;
}

4
tests/mod-secdownload.t

@ -39,9 +39,9 @@ GET /sec/$m/$thex$f HTTP/1.0
Host: vvv.example.org
EOF
);
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 408 } ];
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 410 } ];
ok($tf->handle_http($t) == 0, 'secdownload - timeout');
ok($tf->handle_http($t) == 0, 'secdownload - gone (timeout)');
$t->{REQUEST} = ( <<EOF
GET /sec$f HTTP/1.0

Loading…
Cancel
Save