HTTP: fixed variable caching.

When a variable is accessed in the Unit configuration, the value is cached.
This was useful prior to the URI rewrite feature, but now that the URI (more
precisely, the request target) can be rewritten, the contents of the variable
$uri (which contains the path part of the request target, and is decoded)
should not be cached anymore, or at least the cached value should be invalidated
after a URI rewrite.

Example:

{
	"rewrite": "/prefix$uri",
	"share": "$uri"
}

For a request line like GET /foo?bar=baz HTTP/1.1\r\n, the expected file
served in the response would be /prefix/foo, but due to the caching issue,
Unit currently serves /foo.
This commit is contained in:
Zhidao HONG
2023-05-25 00:27:55 +08:00
parent ce2405ec3d
commit a378f6aa31
4 changed files with 48 additions and 15 deletions

View File

@@ -32,6 +32,12 @@ NGINX Unit updated to 1.31.0.
date="" time=""
packager="Nginx Packaging <nginx-packaging@f5.com>">
<change type="bugfix">
<para>
ensure that $uri variable is not cached.
</para>
</change>
<change type="bugfix">
<para>
deprecated options were unavailable.