unit/test/python
OutOfFocus4 6dae517ebd Python: Added "prefix" to configuration.
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-14 11:30:30 +01:00
..
204_no_content Tests: style. 2022-04-11 21:05:14 +01:00
atexit Tests: style. 2021-04-05 14:03:05 +01:00
body_array Tests: more Python tests. 2018-04-02 17:03:41 +03:00
body_generate Tests: test_settings_send_timeout improved. 2021-05-24 05:26:15 +01:00
body_io Tests: style. 2021-04-05 14:03:05 +01:00
body_io_file Tests: more Python tests. 2018-04-02 17:03:41 +03:00
callable Tests: style. 2021-04-05 14:03:05 +01:00
client_ip Tests: client IP address replacement. 2021-08-12 08:23:23 +00:00
close Unit application library. 2018-08-06 17:27:33 +03:00
close_error Unit application library. 2018-08-06 17:27:33 +03:00
ctx_iter_atexit Tests: minor fixes. 2022-09-07 01:11:04 +01:00
custom_header Tests: style. 2021-04-05 14:03:05 +01:00
delayed Tests: style. 2021-04-05 14:03:05 +01:00
empty Tests: style. 2021-04-05 14:03:05 +01:00
environment Tests: style. 2021-04-05 14:03:05 +01:00
errors_write Tests: added flush() in "errors_write" Python application. 2019-10-23 16:05:35 +03:00
forwarded_header Tests: forwarded header replacement tests. 2022-06-20 17:19:35 +08:00
header_fields Tests: style. 2021-04-05 14:03:05 +01:00
host Tests: style. 2021-04-05 14:03:05 +01:00
input_iter Tests: added Python input readline and iterator tests. 2020-03-12 17:54:15 +03:00
input_read_length Tests: more Python tests. 2018-04-02 17:03:41 +03:00
input_readline Tests: added Python input readline and iterator tests. 2020-03-12 17:54:15 +03:00
input_readline_size Tests: added Python input readline and iterator tests. 2020-03-12 17:54:15 +03:00
input_readlines Tests: added Python input readline and iterator tests. 2020-03-12 17:54:15 +03:00
iter_exception Tests: style. 2021-04-05 14:03:05 +01:00
legacy Tests: style. 2021-04-05 14:03:05 +01:00
legacy_force Tests: style. 2021-04-05 14:03:05 +01:00
lifespan Tests: Python targets. 2021-05-20 13:03:12 +00:00
log_body Handling change file message in libunit. 2020-03-30 14:18:41 +03:00
mirror Tests: style. 2021-04-05 14:03:05 +01:00
not_iterable Tests: added Python test with not iterable object. 2018-04-05 17:55:06 +03:00
ns_inspect Tests: Added rootfs tests. 2020-05-28 14:59:52 +01:00
path Tests: style. 2021-04-05 14:03:05 +01:00
prefix Python: Added "prefix" to configuration. 2022-12-14 11:30:30 +01:00
query_string Tests: style. 2021-04-05 14:03:05 +01:00
restart Tests: style. 2021-10-18 01:10:11 +01:00
server_port Tests: style. 2021-04-05 14:03:05 +01:00
start_response_exit Tests: more Python tests. 2018-04-02 17:03:41 +03:00
syntax_error Tests: more Python tests. 2018-04-02 17:03:41 +03:00
targets Python: Added "prefix" to configuration. 2022-12-14 11:30:30 +01:00
threading Tests: style. 2021-10-18 01:10:11 +01:00
threads Tests: style. 2021-10-18 01:10:11 +01:00
upload Tests: style. 2021-10-18 01:10:11 +01:00
user_group Tests: style. 2021-04-05 14:03:05 +01:00
variables Tests: style. 2021-04-05 14:03:05 +01:00
websockets Tests: style. 2021-04-05 14:03:05 +01:00
write Tests: added test for callable write() in Python. 2018-04-26 17:37:24 +03:00