comparison src/http/modules/ngx_http_headers_filter_module.c @ 238:a528ae0fe909 NGINX_0_4_4

nginx 0.4.4 *) Feature: the $scheme variable. *) Feature: the "expires" directive supports the "max" parameter. *) Feature: the "include" directive supports the "*" mask. Thanks to Jonathan Dance. *) Bugfix: the "return" directive always overrode the "error_page" response code redirected by the "error_page" directive. *) Bugfix: a segmentation fault occurred if zero-length body was in PUT method. *) Bugfix: the redirect was changed incorrectly if the variables were used in the "proxy_redirect" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 02 Oct 2006 00:00:00 +0400
parents c982febb7588
children 5bef04fc3fd5
comparison
equal deleted inserted replaced
237:302a8e8b4ae7 238:a528ae0fe909
24 24
25 25
26 #define NGX_HTTP_EXPIRES_UNSET -2147483647 26 #define NGX_HTTP_EXPIRES_UNSET -2147483647
27 #define NGX_HTTP_EXPIRES_OFF -2147483646 27 #define NGX_HTTP_EXPIRES_OFF -2147483646
28 #define NGX_HTTP_EXPIRES_EPOCH -2147483645 28 #define NGX_HTTP_EXPIRES_EPOCH -2147483645
29 #define NGX_HTTP_EXPIRES_MAX -2147483644
29 30
30 31
31 static void *ngx_http_headers_create_conf(ngx_conf_t *cf); 32 static void *ngx_http_headers_create_conf(ngx_conf_t *cf);
32 static char *ngx_http_headers_merge_conf(ngx_conf_t *cf, 33 static char *ngx_http_headers_merge_conf(ngx_conf_t *cf,
33 void *parent, void *child); 34 void *parent, void *child);
175 expires->value.data = (u_char *) "Thu, 01 Jan 1970 00:00:01 GMT"; 176 expires->value.data = (u_char *) "Thu, 01 Jan 1970 00:00:01 GMT";
176 177
177 cc->value.len = sizeof("no-cache") - 1; 178 cc->value.len = sizeof("no-cache") - 1;
178 cc->value.data = (u_char *) "no-cache"; 179 cc->value.data = (u_char *) "no-cache";
179 180
181 } else if (conf->expires == NGX_HTTP_EXPIRES_MAX) {
182 expires->value.data = (u_char *) "Thu, 31 Dec 2037 23:55:55 GMT";
183
184 /* 10 years */
185 cc->value.len = sizeof("max-age=315360000") - 1;
186 cc->value.data = (u_char *) "max-age=315360000";
187
180 } else { 188 } else {
181 expires->value.data = ngx_palloc(r->pool, len); 189 expires->value.data = ngx_palloc(r->pool, len);
182 if (expires->value.data == NULL) { 190 if (expires->value.data == NULL) {
183 return NGX_ERROR; 191 return NGX_ERROR;
184 } 192 }
347 if (ngx_strcmp(value[1].data, "epoch") == 0) { 355 if (ngx_strcmp(value[1].data, "epoch") == 0) {
348 hcf->expires = NGX_HTTP_EXPIRES_EPOCH; 356 hcf->expires = NGX_HTTP_EXPIRES_EPOCH;
349 return NGX_CONF_OK; 357 return NGX_CONF_OK;
350 } 358 }
351 359
360 if (ngx_strcmp(value[1].data, "max") == 0) {
361 hcf->expires = NGX_HTTP_EXPIRES_MAX;
362 return NGX_CONF_OK;
363 }
364
352 if (ngx_strcmp(value[1].data, "off") == 0) { 365 if (ngx_strcmp(value[1].data, "off") == 0) {
353 hcf->expires = NGX_HTTP_EXPIRES_OFF; 366 hcf->expires = NGX_HTTP_EXPIRES_OFF;
354 return NGX_CONF_OK; 367 return NGX_CONF_OK;
355 } 368 }
356 369