comparison src/http/modules/ngx_http_fastcgi_module.c @ 3197:d5d1ad05d3a6

hide cacheable Set-Cookie and P3P FastCGI response headers
author Igor Sysoev <igor@sysoev.ru>
date Wed, 07 Oct 2009 15:15:41 +0000
parents baff3edcb6e2
children fcd98af88df3
comparison
equal deleted inserted replaced
3196:b7e68ee09e0c 3197:d5d1ad05d3a6
519 ngx_string("X-Accel-Limit-Rate"), 519 ngx_string("X-Accel-Limit-Rate"),
520 ngx_string("X-Accel-Buffering"), 520 ngx_string("X-Accel-Buffering"),
521 ngx_string("X-Accel-Charset"), 521 ngx_string("X-Accel-Charset"),
522 ngx_null_string 522 ngx_null_string
523 }; 523 };
524
525
526 #if (NGX_HTTP_CACHE)
527
528 static ngx_str_t ngx_http_fastcgi_hide_cache_headers[] = {
529 ngx_string("Status"),
530 ngx_string("X-Accel-Expires"),
531 ngx_string("X-Accel-Redirect"),
532 ngx_string("X-Accel-Limit-Rate"),
533 ngx_string("X-Accel-Buffering"),
534 ngx_string("X-Accel-Charset"),
535 ngx_string("Set-Cookie"),
536 ngx_string("P3P"),
537 ngx_null_string
538 };
539
540 #endif
524 541
525 542
526 static ngx_path_init_t ngx_http_fastcgi_temp_path = { 543 static ngx_path_init_t ngx_http_fastcgi_temp_path = {
527 ngx_string(NGX_HTTP_FASTCGI_TEMP_PATH), { 1, 2, 0 } 544 ngx_string(NGX_HTTP_FASTCGI_TEMP_PATH), { 1, 2, 0 }
528 }; 545 };
1897 ngx_http_fastcgi_loc_conf_t *conf = child; 1914 ngx_http_fastcgi_loc_conf_t *conf = child;
1898 1915
1899 u_char *p; 1916 u_char *p;
1900 size_t size; 1917 size_t size;
1901 uintptr_t *code; 1918 uintptr_t *code;
1919 ngx_str_t *h;
1902 ngx_uint_t i; 1920 ngx_uint_t i;
1903 ngx_keyval_t *src; 1921 ngx_keyval_t *src;
1904 ngx_hash_init_t hash; 1922 ngx_hash_init_t hash;
1905 ngx_http_script_compile_t sc; 1923 ngx_http_script_compile_t sc;
1906 ngx_http_script_copy_code_t *copy; 1924 ngx_http_script_copy_code_t *copy;
2117 2135
2118 hash.max_size = 512; 2136 hash.max_size = 512;
2119 hash.bucket_size = ngx_align(64, ngx_cacheline_size); 2137 hash.bucket_size = ngx_align(64, ngx_cacheline_size);
2120 hash.name = "fastcgi_hide_headers_hash"; 2138 hash.name = "fastcgi_hide_headers_hash";
2121 2139
2140 #if (NGX_HTTP_CACHE)
2141
2142 h = conf->upstream.cache ? ngx_http_fastcgi_hide_cache_headers:
2143 ngx_http_fastcgi_hide_headers;
2144 #else
2145
2146 h = ngx_http_fastcgi_hide_headers;
2147
2148 #endif
2149
2122 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, 2150 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
2123 &prev->upstream, 2151 &prev->upstream, h, &hash)
2124 ngx_http_fastcgi_hide_headers,
2125 &hash)
2126 != NGX_OK) 2152 != NGX_OK)
2127 { 2153 {
2128 return NGX_CONF_ERROR; 2154 return NGX_CONF_ERROR;
2129 } 2155 }
2130 2156