Commit Graph

331 Commits (6252c682da883ae761d5c9685e5c96fd1c360168)

Author SHA1 Message Date
Glenn Strauss 63beba3a4c [core] allow redirect,rewrite ext subst w/o pcre
allow redirect and rewrite extended substitution when lighttpd is built
without pcre.  When built without pcre, url.rewrite and url.redirect
always match first list entry as if it were "", and numerical
substitutions ($0 %0 $1 %1 etc) are always ignored, but other extended
substitutions (e.g. ${url.path}) may still occur.
12 months ago
Glenn Strauss 7258624e51 [tests] able to run tests when built w/o pcre
perl test framework now runs most tests even when lighttpd has been
built without pcre support, though some tests which rely on regex
are skipped (tests/core-condition.t)
12 months ago
Glenn Strauss bd67d9f4ac [core] permit env w/ blank value (fix regression)
(thx Lars Bingchong)

empty env var must be set to blank string and not left unset
(regression in lighttpd 1.4.56 - lighttpd 1.4.64)

x-ref:
  https://stackoverflow.com/a/52913064/1338888
1 year ago
Glenn Strauss d1b5f52e96 [tests] revert _WIN32 adjustments in LightyTest.pm
This reverts commit c1bc5efe9a.
1 year ago
Glenn Strauss c1bc5efe9a [tests] _WIN32 adjustments in LightyTest.pm
separate cygwin paths from Windows native paths

remove unnecessary variables
remove unnecessary file copies
1 year ago
Glenn Strauss 93bc7f2695 [core] allow tests/tmp/bind.conf override (#3137)
optional bind spec override for tests/*.conf,
e.g. for use on platforms w/o socket activation

x-ref:
  "TRACEME environment option in tests broken with LISTEN_PID"
  https://redmine.lighttpd.net/issues/3137
1 year ago
Glenn Strauss 1e335b3724 [core] allow LISTEN_PID to be ppid if TRACEME (fixes #3137)
allow LISTEN_PID to be ppid (parent pid) if TRACEME set in environment
(e.g. for strace, gdb on Linux; valgrind starts lighttpd as LISTEN_PID)

x-ref:
  "TRACEME environment option in tests broken with LISTEN_PID"
  https://redmine.lighttpd.net/issues/3137
1 year ago
David Carlier c0f040eae7 [build] Haiku build fix (fixes #3136)
Haiku needs to link to additional lib -lnetwork for socket funcs
(similar to Solaris need for -lsocket -lnsl)

(edited: gstrauss)

x-ref:
  "haiku build fix proposal"
  https://redmine.lighttpd.net/issues/3136
1 year ago
Glenn Strauss b9d58fa723 [build] cmake,meson socket libs for win32, Illumos (fixes #3130)
(thx devnexen)

cmake, meson: specify socket libs for win32, Illumos

x-ref:
  "Solaris build fix proposal"
  https://redmine.lighttpd.net/issues/3130
1 year ago
Glenn Strauss a931b1fce2 [core] define __EXTENSIONS__ on Illumos
(thx devnexen)
1 year ago
Glenn Strauss 2c39174649 [build] update tests/SConscript 1 year ago
Glenn Strauss 3034147e51 [tests] remove unused mod from tests/lighttpd.conf
remove unused module mod_userdir from tests/lighttpd.conf
(module is tested in src/t/test_mod_userdir.c)
1 year ago
Glenn Strauss adf2f816df [tests] mod_ssi tests moved to src/t/test_mod_ssi
remove mod_ssi Perl tests now performed by src/t/test_mod_ssi
1 year ago
Glenn Strauss a2bfccd1be [tests] force Fcntl::F_SETFD() autovivification (#3110)
x-ref:
  "RPM build fails at Lighttest.pm"
  https://redmine.lighttpd.net/issues/3110
1 year ago
Glenn Strauss 78eb0e3945 [tests] force POSIX::WNOHANG() autovivification (fixes #3110)
x-ref:
  "RPM build fails at Lighttest.pm"
  https://redmine.lighttpd.net/issues/3110
1 year ago
Glenn Strauss ed2c698300 [tests] ignore SIGINT, SIGUSR1 in fcgi-responder
ignore SIGINT, SIGUSR1 in fcgi-responder if HAVE_SIGNAL is defined
(must be defined separately since config.h is not included)

Not required for test framework.  Added as an example in the code,
e.g. if code is reused with lighttpd and graceful shutdown or restart.
(backend will be sent SIGTERM when server is ready to restart)
2 years ago
Glenn Strauss 9a37ba54d1 [tests] skip time-sensitive test during CI testing 2 years ago
Glenn Strauss 18ec4f419c [tests] move tests/docroot/www contents up 1 level
reduce directories under tests
(because automake is sloooow and the fewer dirs, the better)
2 years ago
Glenn Strauss 83338cb7dd [tests] IO::Socket::INET->new( Timeout => 1 )
(to be used when supported by the underlying Perl lib)
2 years ago
Glenn Strauss ca2898f678 [tests] t/test_mod_indexfile
also remove some now-redundant tests from request.t
and reduce scripts and directories under tests
(because automake is sloooow and the fewer dirs, the better)
2 years ago
Glenn Strauss 9c9cd37320 [tests] speed up mod-fastcgi and mod-scgi tests
On platforms where lighttpd gets SIGCHLD,
lighttpd can quickly detect exit of backend process
and can restart backend process
2 years ago
Glenn Strauss 5294d7e18f [tests] combine *.t using tests/condition.conf
combine tests/*.t using tests/condition.conf into tests/core-condition.t

Platforms which are horrifically slow starting processes (e.g. Windows)
take much more time to start and stop lighttpd many times for
independent *.t instances run through the Perl Test::More framework
2 years ago
Glenn Strauss f472611597 [tests] combine *.t using tests/lighttpd.conf
combine tests/*.t using tests/lighttpd.conf into tests/request.t

Platforms which are horrifically slow starting processes (e.g. Windows)
take much more time to start and stop lighttpd many times for
independent *.t instances run through the Perl Test::More framework
2 years ago
Glenn Strauss 91472ab768 [tests] t/test_mod_staticfile
move some tests from tests/request.t to src/t/test_mod_staticfile.c
2 years ago
Glenn Strauss a0a8cf821d [tests] mv tests from request.t to test_request.c
move some tests from tests/*.t to src/t/test_request.c
2 years ago
Glenn Strauss f7bebe99a5 [tests] use generated date in HTTP If conditionals
replace hard-coded date in HTTP If conditional tests

x-ref:
  "Make tests pass after 2035"
  https://github.com/lighttpd/lighttpd1.4/pull/106

github: closes #106
2 years ago
Glenn Strauss 6881f79c32 [mod_auth] detect and skip BWS (bad whitespace)
detect and skip BWS (bad whitespace) in Authorization
2 years ago
Glenn Strauss e2bd776f8f [tests] disable secdownload HMAC tests for NSS
NSS crypto lib does not expose interfaces to HMAC funcs
2 years ago
Glenn Strauss cc35c03c3c [core] RFC 7233 Range handling for non-streaming
RFC 7233 Range handling for all non-streaming responses,
including (non-streaming) dynamic responses

(previously Range responses handled only for static files)
2 years ago
Glenn Strauss dc4ff14c1f [tests] remove stray option in test lighttpd.conf 2 years ago
Glenn Strauss 5b1b9f7824 [tests] use ephemeral ports in tests
avoid spurious test failures due to conflicts with ports in use by
other processes, which might occur when tests use hard-coded ports
2 years ago
Glenn Strauss 5ec5e124c1 [tests] consolidate some tests/ content 2 years ago
Glenn Strauss db0cd76618 [build] add GNUMAKEFLAGS=--no-print-directory
quiet some automake noise during build
(can use 'make -s' to quiet more)

In doc/ and tests/docroot/, add GNUMAKEFLAGS=--no-print-directory -s
2 years ago
Glenn Strauss 0c6a6d06c6 [tests] OpenBSD crypt() support limited to bcrypt
OpenBSD crypt() does not support (insecure) crypt-des or crypt-md5

(The password used in the tests and lighttpd.htpasswd is crypt-des.
 Something else could be used so that the tests can execute,
 though that something might be different on different platforms.)
2 years ago
Glenn Strauss 91e94f4875 [tests] load required modules in alt .conf tests
load only required modules in alt .conf tests
2 years ago
Glenn Strauss d228b06655 [tests] slight speed up checking for server ready
make connection attempt every 10ms instead of every 20ms
2 years ago
Glenn Strauss 122094e3e3 [multiple] employ http_date.h, sys-time.h
- replace use of strptime() w/ implementation specialized for HTTP dates
- use thread-safe gmtime_r(), localtime_r() (replace localtime, gmtime)
2 years ago
Glenn Strauss b598bb53f9 [tests] remove FastCGI test dependency on PHP 2 years ago
Glenn Strauss fc01b820ec [tests] remove FastCGI test dependency on libfcgi
- rewrite fcgi-responder as standalone app
  fcgi-responder is now a minimal, standalone FastCGI server for tests
- remove dependency on fcgi-devel package
- merge fcgi-auth into fcgi-responder
2 years ago
Glenn Strauss c68a7b4552 [tests] collect code for "die-at-end" tests 2 years ago
Glenn Strauss 213373948a [tests] allow LIGHTTPD_EXE_PATH override
allow LIGHTTPD_EXE_PATH override to be able to run source tree tests/*.t
against installed executable, e.g. LIGHTTPD_EXE_PATH=/usr/sbin/lighttpd

Beware that tests might not pass or might not be supported if the target
executable is not the same version as that of the source tree

(Possible use for this override is by Debian autopkgtests)
2 years ago
Glenn Strauss 2576b2c3d0 [tests] OpenBSD crypt() support limited to bcrypt
OpenBSD crypt() does not support (insecure) crypt-des or crypt-md5
2 years ago
Glenn Strauss a363383a92 [tests] detect multiple SSL/TLS/crypto providers 2 years ago
Glenn Strauss dc51e9d61c [tests] simulate slow, small packets more quickly
simulate slow, small packets more quickly
1ms between chars is plenty slow; 100ms is excessive

fixup
2 years ago
Glenn Strauss 96abd9cfb8 [core] coalesce nearby ranges in Range requests
Range requests must be HTTP/1.1 or later (not HTTP/1.0)
2 years ago
Glenn Strauss 1d9709b8ab [core] update HTTP status codes list from IANA 2 years ago
Glenn Strauss 140c0fb8f4 [doc] update README and INSTALL
also add tests/README with some testing notes
2 years ago
Glenn Strauss a3af9833c6 [core] fix crash on master if blank line request
(bug on master branch; never released)

(thx avij)

fix crash on master if blank line precedes HTTP/1.1 keep-alive request

header parsing code previously made assumptions that request was
HTTP/1.0 or HTTP/1.1, where a request-line was required, and which
would error out elsewhere if request-line was missing.  The parsing
code also previously looked for "\r\n\r\n" to end headers.

The header offset parsing code was modified and invalidated the above
assumptions, now looking only for blank line "\r\n", but the calling
code had not properly been updated.  (until this patch)
2 years ago
Glenn Strauss 8e2cf55250 [core] redirect to dir using relative-path
Location response header is permitted to use relative-path in
RFC 7231 Section 7.1.2. Location

Prefer relative path in redirection for the benefit of reverse proxies
and CDNs.  Doing so also avoids potentially disclosing internal schemes
and server names which client might not be able to directly reach.

To restore prior behavior of sending a fully-qualified absolute URI:
server.feature-flags += ("absolute-dir-redirect" => "enable")

x-ref:
  https://bz.apache.org/bugzilla/show_bug.cgi?id=63357
2 years ago
Stefan Bühler 5515bb2a08 scons: fix check environment
if os.environ is a special class the scons.Environment Clone() doesn't
work properly.

show builddir in prepare.sh so we can actually see it works.
3 years ago