comparison src/http/modules/ngx_http_uwsgi_module.c @ 3670:2728c4e4a9ae

do not use a cache headers set to hide
author Igor Sysoev <igor@sysoev.ru>
date Fri, 02 Jul 2010 10:05:40 +0000
parents 12bd9e26fadb
children 045ea40cbfe8
comparison
equal deleted inserted replaced
3669:1f5841b1fcd7 3670:2728c4e4a9ae
368 }; 368 };
369 369
370 370
371 #if (NGX_HTTP_CACHE) 371 #if (NGX_HTTP_CACHE)
372 372
373 static ngx_str_t ngx_http_uwsgi_hide_cache_headers[] = {
374 ngx_string("X-Accel-Expires"),
375 ngx_string("X-Accel-Redirect"),
376 ngx_string("X-Accel-Limit-Rate"),
377 ngx_string("X-Accel-Buffering"),
378 ngx_string("X-Accel-Charset"),
379 ngx_string("Set-Cookie"),
380 ngx_string("P3P"),
381 ngx_null_string
382 };
383
384
385 static ngx_keyval_t ngx_http_uwsgi_cache_headers[] = { 373 static ngx_keyval_t ngx_http_uwsgi_cache_headers[] = {
386 { ngx_string("HTTP_IF_MODIFIED_SINCE"), ngx_string("") }, 374 { ngx_string("HTTP_IF_MODIFIED_SINCE"), ngx_string("") },
387 { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") }, 375 { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") },
388 { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("") }, 376 { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("") },
389 { ngx_string("HTTP_IF_MATCH"), ngx_string("") }, 377 { ngx_string("HTTP_IF_MATCH"), ngx_string("") },
1102 ngx_http_uwsgi_loc_conf_t *conf = child; 1090 ngx_http_uwsgi_loc_conf_t *conf = child;
1103 1091
1104 u_char *p; 1092 u_char *p;
1105 size_t size; 1093 size_t size;
1106 uintptr_t *code; 1094 uintptr_t *code;
1107 ngx_str_t *hide;
1108 ngx_uint_t i; 1095 ngx_uint_t i;
1109 ngx_array_t headers_names; 1096 ngx_array_t headers_names;
1110 ngx_keyval_t *src; 1097 ngx_keyval_t *src;
1111 ngx_hash_key_t *hk; 1098 ngx_hash_key_t *hk;
1112 ngx_hash_init_t hash; 1099 ngx_hash_init_t hash;
1323 1310
1324 hash.max_size = 512; 1311 hash.max_size = 512;
1325 hash.bucket_size = ngx_align(64, ngx_cacheline_size); 1312 hash.bucket_size = ngx_align(64, ngx_cacheline_size);
1326 hash.name = "uwsgi_hide_headers_hash"; 1313 hash.name = "uwsgi_hide_headers_hash";
1327 1314
1328 #if (NGX_HTTP_CACHE)
1329
1330 hide = conf->upstream.cache ? ngx_http_uwsgi_hide_cache_headers:
1331 ngx_http_uwsgi_hide_headers;
1332 #else
1333
1334 hide = ngx_http_uwsgi_hide_headers;
1335
1336 #endif
1337
1338 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, 1315 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
1339 &prev->upstream, hide, &hash) 1316 &prev->upstream, ngx_http_uwsgi_hide_headers, &hash)
1340 != NGX_OK) 1317 != NGX_OK)
1341 { 1318 {
1342 return NGX_CONF_ERROR; 1319 return NGX_CONF_ERROR;
1343 } 1320 }
1344 1321