comparison src/http/modules/proxy/ngx_http_proxy_header.c @ 315:39b6f2df45c0

nginx-0.0.3-2004-04-14-21:44:28 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 14 Apr 2004 17:44:28 +0000
parents 5cfd65b8b0a7
children ca9a7f8c86da
comparison
equal deleted inserted replaced
314:d71c87d11b16 315:39b6f2df45c0
17 17
18 r = p->request; 18 r = p->request;
19 19
20 h = headers_in->headers.elts; 20 h = headers_in->headers.elts;
21 for (i = 0; i < headers_in->headers.nelts; i++) { 21 for (i = 0; i < headers_in->headers.nelts; i++) {
22
23 /* ignore some headers */
22 24
23 if (&h[i] == headers_in->connection) { 25 if (&h[i] == headers_in->connection) {
24 continue; 26 continue;
25 } 27 }
26 28
49 51
50 continue; 52 continue;
51 } 53 }
52 } 54 }
53 55
56
57 /* "Content-Type" is handled specially */
58
54 if (&h[i] == headers_in->content_type) { 59 if (&h[i] == headers_in->content_type) {
55 r->headers_out.content_type = &h[i]; 60 r->headers_out.content_type = &h[i];
56 r->headers_out.content_type->key.len = 0; 61 r->headers_out.content_type->key.len = 0;
57 continue; 62 continue;
58 } 63 }
64
65
66 /* copy some header pointers and set up r->headers_out */
59 67
60 if (!(ho = ngx_http_add_header(&r->headers_out, ngx_http_headers_out))) 68 if (!(ho = ngx_http_add_header(&r->headers_out, ngx_http_headers_out)))
61 { 69 {
62 return NGX_ERROR; 70 return NGX_ERROR;
63 } 71 }
64 72
65 *ho = h[i]; 73 *ho = h[i];
66 74
75 if (&h[i] == headers_in->expires) {
76 r->headers_out.expires = ho;
77 continue;
78 }
79
80 if (&h[i] == headers_in->cache_control) {
81 r->headers_out.cache_control = ho;
82 continue;
83 }
84
85 if (&h[i] == headers_in->etag) {
86 r->headers_out.etag = ho;
87 continue;
88 }
89
90 if (&h[i] == headers_in->last_modified) {
91 r->headers_out.last_modified = ho;
92 /* TODO: update r->headers_out.last_modified_time */
93 continue;
94 }
95
67 /* 96 /*
68 * ngx_http_header_filter() does not handle specially 97 * ngx_http_header_filter() passes the following headers as is
69 * the following headers if they are set: 98 * and does not handle them specially if they are set:
70 * r->headers_out.server, 99 * r->headers_out.server,
71 * r->headers_out.date, 100 * r->headers_out.date,
72 * r->headers_out.content_length 101 * r->headers_out.content_length
73 */ 102 */
74 103