2230:83b2d20d8f5c | 16-Sep-2022 |
Andrew Clayton |
PHP: allowed to specify URLs without a trailing '/'.
Both @lucatacconi & @mwoodpatrick reported what appears to be the same issue on GitHub. Namely that when using the PHP language module and trying
PHP: allowed to specify URLs without a trailing '/'.
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>
show more ...
|
2215:2c015bf26fac | 13-Oct-2022 |
Andrei Zeliankou |
Tests: added tests for the $request_time variable. |
2213:591f976b08dd | 11-Oct-2022 |
Andrei Zeliankou |
Tests: reworked "test_variables.py".
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
Tests: reworked "test_variables.py".
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".
show more ...
|
2212:975ab1624784 | 11-Oct-2022 |
Andrei Zeliankou |
Tests: don't try to return response when "no_recv" is True. |
2205:f5d74e8deb10 | 26-Sep-2022 |
Andrei Zeliankou |
Tests: added test with proxy for status. |
2203:6b6b979e8214 | 18-Sep-2022 |
Zhidao HONG |
HTTP: fixed cookie parsing.
The fixing supports the cookie value with the '=' character.
This is related to #756 PR on Github. Thanks to changxiaocui. |
Revision tags: 1.28.0-1, 1.28.0 |
|
2190:fbfec2aaf4c3 | 07-Sep-2022 |
Andrei Zeliankou |
Tests: minor fixes. |
2187:ed0ff6e170d0 | 05-Sep-2022 |
Andrei Zeliankou |
Tests: added tests for basic statistics. |
2182:55860ad40a93 | 25-Aug-2022 |
Andrei Zeliankou |
Tests: added tests with abstract UNIX sockets. |
2177:bd12f07de5c4 | 16-Aug-2022 |
Andrei Zeliankou |
Tests: added test for ASGI with UNIX socket. |
2174:a7fb5d8a9590 | 17-Feb-2022 |
Max Romanov |
Fixing isolated process PID manipulation.
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
Fixing isolated process PID manipulation.
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.
show more ...
|
2171:20f712007059 | 08-Aug-2022 |
Andrei Zeliankou |
Tests: added tests with UNIX sockets in "source". |
2168:c7c634e6dd30 | 28-Jul-2022 |
Andrei Zeliankou |
Tests: added tests for the log format.
Also added tests for the following variables: $request_line, $time_local, $bytes_sent, and $status. |
2167:e38ab67c7f63 | 28-Jul-2022 |
Andrei Zeliankou |
Tests: added flags to search functions in proto.py.
Also removed unnesessary re.compile() calls. |
2163:67d2d679509e | 09-Jun-2022 |
Alejandro Colomar |
Ruby: fixed contents of SCRIPT_NAME.
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
Ruby: fixed contents of SCRIPT_NAME.
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".'.
show more ...
|
2159:cd24064ec2ee | 20-Jul-2022 |
Andrew Clayton |
Tests: added tests for translating $dollar into a literal $.
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 settin
Tests: added tests for translating $dollar into a literal $.
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.
show more ...
|
2157:6b6ac75272b5 | 19-Jul-2022 |
Andrei Zeliankou |
Tests: added tests for more HTTP variables. |
2148:41dc6997c6fe | 14-Jul-2022 |
Andrei Zeliankou |
Tests: added tests for dynamic variables. |
2144:b14caaedca5e | 30-Jun-2022 |
Andrei Zeliankou |
Tests: minor improvements.
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_
Tests: minor improvements.
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.
show more ...
|
2134:f576f11a58b4 | 20-Jun-2022 |
Zhidao HONG |
Tests: forwarded header replacement tests. |
2130:638b03fe73f0 | 20-Jun-2022 |
Zhidao HONG |
Tests: reworked client IP tests. |
Revision tags: 1.27.0-1, 1.27.0 |
|
2114:c483df06e58c | 01-Jun-2022 |
Andrei Zeliankou |
Tests: improved test for $request_uri variable. |
2112:94d2a108d227 | 31-May-2022 |
Andrei Zeliankou |
Tests: removed deprecated ssl.PROTOCOL_TLSv1_2 constant. |
2111:bfbe40d3c24b | 30-May-2022 |
Alejandro Colomar |
Tests: Added tests for $request_uri. |
2109:8a068eaba1e7 | 21-Feb-2022 |
Alejandro Colomar |
Tests: added tests for "index" (string) option. |