<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/test, branch 1.29.1-1</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>Tests: added Python tests with encoding.</title>
<updated>2023-02-21T15:35:38+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2023-02-21T15:35:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=1b7cf1f3d00adbbcd17890f1475c2c36f75c3f68'/>
<id>1b7cf1f3d00adbbcd17890f1475c2c36f75c3f68</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>PHP: Fix a potential problem parsing the path.</title>
<updated>2022-11-07T00:06:43+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2022-11-07T00:06:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=420ddd4e493fb390c52ea638b22aa00e12fd2f9a'/>
<id>420ddd4e493fb390c52ea638b22aa00e12fd2f9a</id>
<content type='text'>
@dward on GitHub reported an issue with a URL like

  http://foo.bar/test.php?blah=test.php/foo

where we would end up trying to run the script

  test.php?blah=test.php

In the PHP module the format 'file.php/' is treated as a special case in
nxt_php_dynamic_request() where we check the _path_ part of the url for
the string '.php/'.

The problem is that the path actually also contains the query string,
thus we were finding 'test.php/' in the above URL and treating that
whole path as the script to run.

The fix is simple, replace the strstr(3) with a memmem(3), where we can
limit the amount of path we use for the check.

The trick here and what is not obvious from the code is that while
path.start points to the whole path including the query string,
path.length only contains the length of the _path_ part.

NOTE: memmem(3) is a GNU extension and is neither specified by POSIX or
ISO C, however it is available on a number of other systems, including:
FreeBSD, OpenBSD, NetBSD, illumos, and macOS.

If it comes to it we can implement a simple alternative for systems
which lack memmem(3).

This also adds a test case (provided by @dward) to cover this.

Closes: &lt;https://github.com/nginx/unit/issues/781&gt;
Cc: Andrei Zeliankou &lt;zelenkov@nginx.com&gt;
Reviewed-by: Alejandro Colomar &lt;alx@nginx.com&gt;
Reviewed-by: Andrei Zeliankou &lt;zelenkov@nginx.com&gt; [test]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
@dward on GitHub reported an issue with a URL like

  http://foo.bar/test.php?blah=test.php/foo

where we would end up trying to run the script

  test.php?blah=test.php

In the PHP module the format 'file.php/' is treated as a special case in
nxt_php_dynamic_request() where we check the _path_ part of the url for
the string '.php/'.

The problem is that the path actually also contains the query string,
thus we were finding 'test.php/' in the above URL and treating that
whole path as the script to run.

The fix is simple, replace the strstr(3) with a memmem(3), where we can
limit the amount of path we use for the check.

The trick here and what is not obvious from the code is that while
path.start points to the whole path including the query string,
path.length only contains the length of the _path_ part.

NOTE: memmem(3) is a GNU extension and is neither specified by POSIX or
ISO C, however it is available on a number of other systems, including:
FreeBSD, OpenBSD, NetBSD, illumos, and macOS.

If it comes to it we can implement a simple alternative for systems
which lack memmem(3).

This also adds a test case (provided by @dward) to cover this.

Closes: &lt;https://github.com/nginx/unit/issues/781&gt;
Cc: Andrei Zeliankou &lt;zelenkov@nginx.com&gt;
Reviewed-by: Alejandro Colomar &lt;alx@nginx.com&gt;
Reviewed-by: Andrei Zeliankou &lt;zelenkov@nginx.com&gt; [test]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: added tests for "path" option in isolation/cgroup.</title>
<updated>2022-12-14T19:00:14+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2022-12-14T19:00:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=4b39cb1fc75b42e944e41a522dbdf3d539eff8db'/>
<id>4b39cb1fc75b42e944e41a522dbdf3d539eff8db</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: Added "prefix" to configuration.</title>
<updated>2022-12-14T10:30:30+00:00</updated>
<author>
<name>OutOfFocus4</name>
<email>jeff.iadarola@gmail.com</email>
</author>
<published>2021-11-14T15:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=6dae517ebd20baa2066541e703d6aa594326dd69'/>
<id>6dae517ebd20baa2066541e703d6aa594326dd69</id>
<content type='text'>
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 &lt;zelenkov@nginx.com&gt;
Reviewed-by: Artem Konev &lt;artem.konev@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;zelenkov@nginx.com&gt;
Reviewed-by: Artem Konev &lt;artem.konev@nginx.com&gt;
Signed-off-by: Alejandro Colomar &lt;alx@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Java: upgrading third-party components.</title>
<updated>2022-12-14T01:43:24+00:00</updated>
<author>
<name>Sergey A. Osokin</name>
<email>osa@FreeBSD.org.ru</email>
</author>
<published>2022-12-14T01:43:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=c9c001ee16091c76773d3e9e655d777696dd755a'/>
<id>c9c001ee16091c76773d3e9e655d777696dd755a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: added tests for the large header buffer settings.</title>
<updated>2022-12-13T14:51:11+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2022-12-13T14:51:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=6313cffd26bf88009a871361f3da56444def0288'/>
<id>6313cffd26bf88009a871361f3da56444def0288</id>
<content type='text'>
Added tests for the "large_header_buffer_size" and
"large_header_buffers" configuration options.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added tests for the "large_header_buffer_size" and
"large_header_buffers" configuration options.
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: stop execution if can't unmount any filesystem.</title>
<updated>2022-12-12T16:27:02+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2022-12-12T16:27:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=12e2cbae8a0bf190c8e7d98de6c08aff57d2ae4f'/>
<id>12e2cbae8a0bf190c8e7d98de6c08aff57d2ae4f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: pretty output.</title>
<updated>2022-12-12T16:24:54+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2022-12-12T16:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=648e91a623d3822e8ab4780b452da211ea3ba257'/>
<id>648e91a623d3822e8ab4780b452da211ea3ba257</id>
<content type='text'>
Hide expected alerts by default.
Silence succesfull "go build" information.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Hide expected alerts by default.
Silence succesfull "go build" information.
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: fixed tests to run as privileged user.</title>
<updated>2022-12-09T14:17:49+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2022-12-09T14:17:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=55b9a5307d705da91d3ef317639356c748853a7c'/>
<id>55b9a5307d705da91d3ef317639356c748853a7c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Tests: NJS.</title>
<updated>2022-11-29T01:02:08+00:00</updated>
<author>
<name>Andrei Zeliankou</name>
<email>zelenkov@nginx.com</email>
</author>
<published>2022-11-29T01:02:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=190691ade82f5126271b374dd5b8d0cb57f9473a'/>
<id>190691ade82f5126271b374dd5b8d0cb57f9473a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
