about summary refs log tree commit diff
path: root/pkgs/servers/http/nginx
diff options
context:
space:
mode:
authorYegor Timoshenko <yegortimoshenko@riseup.net>2018-10-16 13:24:34 +0000
committeraszlig <aszlig@nix.build>2019-04-18 09:40:11 +0200
commit1da8eec00fbe79301fcd5ce0b091405fc475fab0 (patch)
treef5591bca76c9e0cf75899dda2b6d3cd5c9aec1dd /pkgs/servers/http/nginx
parentf03302b6362c8291b9390fb3aa6ee8f0d5098ec4 (diff)
downloadnixlib-1da8eec00fbe79301fcd5ce0b091405fc475fab0.tar
nixlib-1da8eec00fbe79301fcd5ce0b091405fc475fab0.tar.gz
nixlib-1da8eec00fbe79301fcd5ce0b091405fc475fab0.tar.bz2
nixlib-1da8eec00fbe79301fcd5ce0b091405fc475fab0.tar.lz
nixlib-1da8eec00fbe79301fcd5ce0b091405fc475fab0.tar.xz
nixlib-1da8eec00fbe79301fcd5ce0b091405fc475fab0.tar.zst
nixlib-1da8eec00fbe79301fcd5ce0b091405fc475fab0.zip
nginx: handle impure symlinks in ETag patch
Diffstat (limited to 'pkgs/servers/http/nginx')
-rw-r--r--pkgs/servers/http/nginx/nix-etag-1.15.4.patch13
1 files changed, 7 insertions, 6 deletions
diff --git a/pkgs/servers/http/nginx/nix-etag-1.15.4.patch b/pkgs/servers/http/nginx/nix-etag-1.15.4.patch
index a4ee95076c1f..4d8a6510cbfe 100644
--- a/pkgs/servers/http/nginx/nix-etag-1.15.4.patch
+++ b/pkgs/servers/http/nginx/nix-etag-1.15.4.patch
@@ -1,14 +1,14 @@
-From a0ac82e4c79f359a7001a265cdb57e35978c6c23 Mon Sep 17 00:00:00 2001
+From f6a978f024d01202f954483423af1b2d5d5159a6 Mon Sep 17 00:00:00 2001
 From: Yegor Timoshenko <yegortimoshenko@riseup.net>
 Date: Fri, 28 Sep 2018 03:27:04 +0000
 Subject: [PATCH] If root is in Nix store, set ETag to its path hash
 
 ---
- src/http/ngx_http_core_module.c | 55 +++++++++++++++++++++++++++++----
- 1 file changed, 49 insertions(+), 6 deletions(-)
+ src/http/ngx_http_core_module.c | 56 +++++++++++++++++++++++++++++----
+ 1 file changed, 50 insertions(+), 6 deletions(-)
 
 diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
-index c57ec00c..4eec7ec5 100644
+index c57ec00c..b7992de2 100644
 --- a/src/http/ngx_http_core_module.c
 +++ b/src/http/ngx_http_core_module.c
 @@ -1583,6 +1583,7 @@ ngx_http_set_etag(ngx_http_request_t *r)
@@ -19,7 +19,7 @@ index c57ec00c..4eec7ec5 100644
  
      clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
  
-@@ -1598,16 +1599,58 @@ ngx_http_set_etag(ngx_http_request_t *r)
+@@ -1598,16 +1599,59 @@ ngx_http_set_etag(ngx_http_request_t *r)
      etag->hash = 1;
      ngx_str_set(&etag->key, "ETag");
  
@@ -39,7 +39,8 @@ index c57ec00c..4eec7ec5 100644
 +    #define NIX_STORE_DIR "/nix/store"
 +    #define NIX_STORE_LEN ngx_strlen(NIX_STORE_DIR)
 +
-+    if (!ngx_strncmp(real, NIX_STORE_DIR, NIX_STORE_LEN)
++    if (r->headers_out.last_modified_time == 1
++        && !ngx_strncmp(real, NIX_STORE_DIR, NIX_STORE_LEN)
 +        && real[NIX_STORE_LEN] == '/'
 +        && real[NIX_STORE_LEN + 1] != '\0')
 +    {