Permalink
Browse files

support for non-upstream,like ngx_lua

  • Loading branch information...
1 parent 35ea7ff commit 5547901547f6807472407bbdbbf2a304356e5bad @weizetao weizetao committed Feb 20, 2014
Showing with 12 additions and 2 deletions.
  1. +12 −2 ngx_http_zip_module.c
View
@@ -192,9 +192,19 @@ ngx_http_zip_main_request_header_filter(ngx_http_request_t *r)
return NGX_ERROR;
/* Look for X-Archive-Files */
- if (ngx_http_upstream_header_variable(r, vv, (uintptr_t)(&ngx_http_zip_header_variable_name)) != NGX_OK
- || vv->not_found || ngx_strncmp(vv->data, "zip", sizeof("zip") - 1) != 0)
+ if ( !r->upstream && ( ngx_http_variable_unknown_header(vv, &ngx_http_zip_header_variable_name,
+ &r->headers_out.headers.part,
+ sizeof("upstream_http_") - 1) != NGX_OK)
+ || vv->not_found || ngx_strncmp(vv->data, "zip", sizeof("zip") - 1) != 0){
+
return ngx_http_next_header_filter(r);
+
+ }else if (r->upstream && ngx_http_upstream_header_variable(r, vv,
+ (uintptr_t)(&ngx_http_zip_header_variable_name)) != NGX_OK
+ || vv->not_found || ngx_strncmp(vv->data, "zip", sizeof("zip") - 1) != 0){
+
+ return ngx_http_next_header_filter(r);
+ }
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "mod_zip: X-Archive-Files found");

0 comments on commit 5547901

Please sign in to comment.