Skip to content

Instantly share code, notes, and snippets.

@loe
Created January 9, 2009 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loe/45269 to your computer and use it in GitHub Desktop.
Save loe/45269 to your computer and use it in GitHub Desktop.
--- src/http/ngx_http_upstream.c 2009-01-09 11:37:58.000000000 -0800
+++ src/http/ngx_http_upstream.c 2009-01-09 12:03:18.000000000 -0800
@@ -1036,8 +1036,8 @@
{
ssize_t n;
ngx_int_t rc;
- ngx_str_t *uri, args;
- ngx_uint_t i, flags;
+ ngx_str_t *uri, args, *hs;
+ ngx_uint_t i, j, flags;
ngx_list_part_t *part;
ngx_table_elt_t *h;
ngx_connection_t *c;
@@ -1280,6 +1280,18 @@
return;
}
}
+ else {
+ hs = u->conf->pass_headers->elts;
+ for (j = 0; j < u->conf->pass_headers->nelts; j++) {
+ if (ngx_strncasecmp(hs[j].data, h[i].key.data, hs[j].len) == 0) {
+ if (ngx_http_upstream_copy_header_line(r, &h[i], 0) != NGX_OK) {
+ ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ return;
+ }
+ break;
+ }
+ }
+ }
}
uri = &u->headers_in.x_accel_redirect->value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment