diff src/http/modules/ngx_http_static_module.c @ 7602:b399246ea45d

Saved some memory allocations. In configurations when "root" has variables, some modules unnecessarily allocated memory for the "Location" header value.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 16 Dec 2019 15:19:01 +0300
parents 0cdee26605f3
children 1bde031b59ff
line wrap: on
line diff
--- 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
 
         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 = '/';