comparison src/http/modules/proxy/ngx_http_proxy_header.c @ 208:0b67be7d4489

nginx-0.0.1-2003-12-08-23:48:12 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 08 Dec 2003 20:48:12 +0000
parents 02a715e85df1
children 87e73f067470
comparison
equal deleted inserted replaced
207:6e0fef527732 208:0b67be7d4489
21 for (i = 0; i < headers_in->headers->nelts; i++) { 21 for (i = 0; i < headers_in->headers->nelts; i++) {
22 22
23 if (&h[i] == headers_in->connection) { 23 if (&h[i] == headers_in->connection) {
24 continue; 24 continue;
25 } 25 }
26 26
27 if (p->accel) { 27 if (p->accel) {
28 if (&h[i] == headers_in->date 28 if (&h[i] == headers_in->date
29 || &h[i] == headers_in->accept_ranges) { 29 || &h[i] == headers_in->accept_ranges) {
30 continue; 30 continue;
31 } 31 }
32 32
33 if (&h[i] == headers_in->x_accel_expires 33 if (&h[i] == headers_in->x_accel_expires
34 && !p->lcf->pass_x_accel_expires) 34 && !p->lcf->pass_x_accel_expires)
35 { 35 {
36 continue; 36 continue;
37 } 37 }
38 38
39 if (&h[i] == headers_in->server && !p->lcf->pass_server) { 39 if (&h[i] == headers_in->server && !p->lcf->pass_server) {
40 continue; 40 continue;
41 } 41 }
42 42
43 if (&h[i] == headers_in->location) { 43 if (&h[i] == headers_in->location) {
44 if (ngx_http_proxy_rewrite_location_header(p, &h[i]) 44 if (ngx_http_proxy_rewrite_location_header(p, &h[i])
45 == NGX_ERROR) 45 == NGX_ERROR)
46 { 46 {
47 return NGX_ERROR; 47 return NGX_ERROR;
48 } 48 }
49 49
50 continue; 50 continue;
51 } 51 }
52 } 52 }
53 53
54 if (&h[i] == headers_in->content_type) { 54 if (&h[i] == headers_in->content_type) {
55 r->headers_out.content_type = &h[i]; 55 r->headers_out.content_type = &h[i];
56 r->headers_out.content_type->key.len = 0; 56 r->headers_out.content_type->key.len = 0;
57 continue; 57 continue;
58 } 58 }
59 59
60 if (!(ho = ngx_http_add_header(&r->headers_out, ngx_http_headers_out))) 60 if (!(ho = ngx_http_add_header(&r->headers_out, ngx_http_headers_out)))
61 { 61 {
62 return NGX_ERROR; 62 return NGX_ERROR;
63 } 63 }
64 64
65 *ho = h[i]; 65 *ho = h[i];
66 66
67 /* 67 /*
68 * ngx_http_header_filter() does not handle specially 68 * ngx_http_header_filter() does not handle specially
69 * the following headers if they are set: 69 * the following headers if they are set:
70 * r->headers_out.server, 70 * r->headers_out.server,
71 * r->headers_out.date, 71 * r->headers_out.date,
120 /* TODO: proxy_reverse */ 120 /* TODO: proxy_reverse */
121 121
122 r->headers_out.location->value.len = uc->location->len 122 r->headers_out.location->value.len = uc->location->len
123 + (loc->value.len - uc->url.len) + 1; 123 + (loc->value.len - uc->url.len) + 1;
124 r->headers_out.location->value.data = 124 r->headers_out.location->value.data =
125 ngx_palloc(r->pool, r->headers_out.location->value.len); 125 ngx_palloc(r->pool, r->headers_out.location->value.len);
126 126
127 if (r->headers_out.location->value.data == NULL) { 127 if (r->headers_out.location->value.data == NULL) {
128 return NGX_ERROR; 128 return NGX_ERROR;
129 } 129 }
130 130