summaryrefslogtreecommitdiffhomepage
path: root/test (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-12-14Tests: added tests for "path" option in isolation/cgroup.Andrei Zeliankou1-0/+123
2022-12-14Python: Added "prefix" to configuration.OutOfFocus410-0/+310
This patch gives users the option to set a `"prefix"` attribute for Python applications, either at the top level or for specific `"target"`s. If the attribute is present, the value of `"prefix"` must be a string beginning with `"/"`. If the value of the `"prefix"` attribute is longer than 1 character and ends in `"/"`, the trailing `"/"` is stripped. The purpose of the `"prefix"` attribute is to set the `SCRIPT_NAME` context value for WSGI applications and the `root_path` context value for ASGI applications, allowing applications to properly route requests regardless of the path that the server uses to expose the application. The context value is only set if the request's URL path begins with the value of the `"prefix"` attribute. In all other cases, the `SCRIPT_NAME` or `root_path` values are not set. In addition, for WSGI applications, the value of `"prefix"` will be stripped from the beginning of the request's URL path before it is sent to the application. Reviewed-by: Andrei Zeliankou <zelenkov@nginx.com> Reviewed-by: Artem Konev <artem.konev@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-12-14Java: upgrading third-party components.Sergey A. Osokin2-8/+11
2022-12-13Tests: added tests for the large header buffer settings.Andrei Zeliankou1-0/+60
Added tests for the "large_header_buffer_size" and "large_header_buffers" configuration options.
2022-12-12Tests: stop execution if can't unmount any filesystem.Andrei Zeliankou2-2/+15
2022-12-12Tests: pretty output.Andrei Zeliankou3-9/+10
Hide expected alerts by default. Silence succesfull "go build" information.
2022-12-09Tests: fixed tests to run as privileged user.Andrei Zeliankou2-8/+15
2022-11-29Tests: NJS.Andrei Zeliankou4-1/+101
2022-11-20Var: improved variable parsing with empty names.Zhidao HONG1-0/+1
Unit parsed the case of "$uri$$host" into unknown variables. This commit makes it invalid variable instead.
2022-11-15Tests: fixed _check_processes() checks in "--restart" mode.Andrei Zeliankou1-0/+4
2022-11-15Tests: removed migration test.Andrei Zeliankou1-46/+0
Migration of "share" behaviour was dropped after b57b4749b993.
2022-11-15Tests: fixed assertion in test_variables_dynamic.Andrei Zeliankou1-4/+7
2022-11-15Tests: features and options checks improved.Andrei Zeliankou3-16/+13
Now version output evaluates only once. OpenSSL checks more carefully.
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.