summaryrefslogtreecommitdiffhomepage
path: root/test (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-11-02PHP: allowed to specify URLs without a trailing '/'.Andrew Clayton1-0/+44
Both @lucatacconi & @mwoodpatrick reported what appears to be the same issue on GitHub. Namely that when using the PHP language module and trying to access a URL that is a directory but without specifying the trailing '/', they were getting a '503 Service Unavailable' error. Note: This is when _not_ using the 'script' option. E.g with the following config { "listeners": { "[::1]:8080": { "pass": "applications/php" } }, "applications": { "php": { "type": "php", "root": "/var/tmp/unit-php" } } } and with a directory path of /var/tmp/unit-php/foo containing an index.php, you would see the following $ curl http://localhost/foo <title>Error 503</title> Error 503 However $ curl http://localhost/foo/ would work and serve up the index.php This commit fixes the above so you get the desired behaviour without specifying the trailing '/' by doing the following 1] If the URL doesn't end in .php and doesn't have a trailing '/' then check if the requested path is a directory. 2) If it is a directory then create a 301 re-direct pointing to it. This matches the behaviour of the likes of nginx, Apache and lighttpd. This also matches the behaviour of the "share" action in Unit. This doesn't effect the behaviour of the 'script' option which bypasses the nxt_php_dynamic_request() function. This also adds a couple of tests to test/test_php_application.py to ensure this continues to work. Closes: <https://github.com/nginx/unit/issues/717> Closes: <https://github.com/nginx/unit/issues/753> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2022-10-13Tests: added tests for the $request_time variable.Andrei Zeliankou1-0/+29
2022-10-11Tests: reworked "test_variables.py".Andrei Zeliankou2-216/+259
Access log used for the variables testing instead of limited routing. Added missed test for $status variable. Some tests moved from "test_access_log.py" to "test_variables.py".
2022-10-11Tests: don't try to return response when "no_recv" is True.Andrei Zeliankou14-50/+30
2022-09-27Tests: added test with proxy for status.Andrei Zeliankou1-44/+51
2022-09-19HTTP: fixed cookie parsing.Zhidao HONG1-0/+14
The fixing supports the cookie value with the '=' character. This is related to #756 PR on Github. Thanks to changxiaocui.
2022-09-07Tests: minor fixes.Andrei Zeliankou11-171/+19
2022-09-05Tests: added tests for basic statistics.Andrei Zeliankou4-0/+301
2022-08-25Tests: added tests with abstract UNIX sockets.Andrei Zeliankou6-1/+176
2022-08-16Tests: added test for ASGI with UNIX socket.Andrei Zeliankou1-0/+10
2022-08-11Fixing isolated process PID manipulation.Max Romanov1-1/+1
Registering an isolated PID in the global PID hash is wrong because it can be duplicated. Isolated processes are stored only in the children list until the response for the WHOAMI message is processed and the global PID is discovered. To remove isolated siblings, a pointer to the children list is introduced in the nxt_process_init_t struct. This closes #633 issue on GitHub.
2022-08-08Tests: added tests with UNIX sockets in "source".Andrei Zeliankou2-4/+37
2022-07-28Tests: added tests for the log format.Andrei Zeliankou1-0/+80
Also added tests for the following variables: $request_line, $time_local, $bytes_sent, and $status.
2022-07-28Tests: added flags to search functions in proto.py.Andrei Zeliankou3-13/+8
Also removed unnesessary re.compile() calls.
2022-07-27Ruby: fixed contents of SCRIPT_NAME.Alejandro Colomar1-1/+1
Having the basename of the script pathname was incorrect. While we don't have something more accurate, the best thing to do is to have it empty (which should be the right thing most of the time). This closes #715 issue on GitHub. The bug was introduced in git commit 0032543fa65f454c471c968998190b027c1ff270 'Ruby: added the Rack environment parameter "SCRIPT_NAME".'.
2022-07-20Tests: added tests for translating $dollar into a literal $.Andrew Clayton1-0/+21
If you need to specify a $ in a URI you can now use '$dollar' or '${dollar}'. Added some tests for the above to test_variables.py setting a Location string.
2022-07-19Tests: added tests for more HTTP variables.Andrei Zeliankou1-0/+51
2022-07-14Tests: added tests for dynamic variables.Andrei Zeliankou1-0/+82
2022-06-30Tests: minor improvements.Andrei Zeliankou5-98/+39
Added "go" availability check before trying to build an application. update_action() method used were possible and fixed bug with the relative path determination in test_static_chroot.py. Templates optimization and style fixes.
2022-06-20Tests: forwarded header replacement tests.Zhidao HONG2-0/+276
2022-06-20Tests: reworked client IP tests.Zhidao HONG1-17/+38
2022-06-01Tests: improved test for $request_uri variable.Andrei Zeliankou1-2/+2
2022-06-01Tests: removed deprecated ssl.PROTOCOL_TLSv1_2 constant.Andrei Zeliankou1-2/+5
2022-05-31Tests: Added tests for $request_uri.Alejandro Colomar1-0/+9
2022-05-30Tests: added tests for "index" (string) option.Alejandro Colomar1-0/+28
2022-05-16Tests: Added tests for empty "location".Alejandro Colomar1-0/+15
2022-05-13Tests: added tests for Ruby stream IO.close().Andrei Zeliankou3-7/+8
2022-05-10Tests: added test for "SCRIPT_NAME" variable in Ruby.Andrei Zeliankou2-0/+2
2022-05-09Tests: added more tests with reconfiguration.Andrei Zeliankou4-51/+155
2022-04-28Tests: Added tests for variables in "location".Alejandro Colomar1-0/+19
2022-04-28Tests: Changed tests to accept variables in "location".Alejandro Colomar1-4/+4
2022-04-12Tests: added check for zombie processes.Andrei Zeliankou1-0/+58
2022-04-11Tests: style.Andrei Zeliankou36-343/+291
2022-02-15Tests: added test with long certificate chain.Andrei Zeliankou1-0/+45
2022-01-31Tests: removed TestApplicationTLS.get_server_certificate().Andrei Zeliankou14-60/+61
distutils.version is replaced by packaging.version. Also minor style fixes.
2022-01-10Tests: using modules in Go.Max Romanov3-45/+38
2021-12-27Perl: creating input and error streams if closed.Max Romanov3-0/+47
Application handler can do anything with a stream object (including close it). Once the stream is closed, Unit creates a new stream. This closes #616 issue on GitHub.
2021-12-12Tests: fixed type of applications.Andrei Zeliankou9-23/+23
2021-12-11Tests: added more OPcache tests.Andrei Zeliankou4-13/+66
2021-12-10Tests: fixed path to the "php.ini" file.Andrei Zeliankou1-2/+10
2021-12-01Tests: fixed skipping tests with disabled OPcache.Andrei Zeliankou1-1/+1
2021-11-15Tests: fixed session reuse tests.Andrei Zeliankou1-17/+13
Since SSL_CTX_sess_set_cache_size() can't guarantee the size of the cache there is no need to test edge "cache_size" values.
2021-11-15Tests: refactored working with processes.Andrei Zeliankou8-39/+39
2021-11-10Tests: added more tests for "query" routing pattern.Andrei Zeliankou1-8/+16
2021-11-09Tests: PHP shared opcache test added.Max Romanov4-9/+54
2021-11-09Tests: app prototype related fixes.Max Romanov5-3/+19
2021-11-05Router: matching query string support.Zhidao HONG1-0/+44
The "query" option matches decoded arguments, including plus ('+') to space (' '). Like "uri", it can be a string or an array of strings.
2021-11-04Tests: added "requirements.txt".Andrei Zeliankou1-0/+2
2021-11-04Tests: added migration test for "share".Andrei Zeliankou2-4/+52
2021-11-02Tests: added pyOpenSSL module check were necessary.Andrei Zeliankou2-0/+4