aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_static_module.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2019-12-16 15:19:01 +0300
committerRuslan Ermilov <ru@nginx.com>2019-12-16 15:19:01 +0300
commitbe45a3aa590a5f7e64c6d55e8e0f78565adf4823 (patch)
treea31f998e08752cce80fa9178baf885bf3c4957b7 /src/http/modules/ngx_http_static_module.c
parent6dc0c880e5b94dc507795369196dec5c2f9d2cc2 (diff)
downloadnginx-be45a3aa590a5f7e64c6d55e8e0f78565adf4823.tar.gz
nginx-be45a3aa590a5f7e64c6d55e8e0f78565adf4823.zip
Saved some memory allocations.
In configurations when "root" has variables, some modules unnecessarily allocated memory for the "Location" header value.
Diffstat (limited to 'src/http/modules/ngx_http_static_module.c')
-rw-r--r--src/http/modules/ngx_http_static_module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c
index 0e16c05a5..282d6ee98 100644
--- a/src/http/modules/ngx_http_static_module.c
+++ b/src/http/modules/ngx_http_static_module.c
@@ -157,8 +157,8 @@ ngx_http_static_handler(ngx_http_request_t *r)
len = r->uri.len + 1;
- if (!clcf->alias && clcf->root_lengths == NULL && r->args.len == 0) {
- location = path.data + clcf->root.len;
+ if (!clcf->alias && r->args.len == 0) {
+ location = path.data + root;
*last = '/';