Mercurial > hg > nginx
comparison src/http/modules/ngx_http_dav_module.c @ 6853:c85dfd99a2dd
Fixed missing "Location" field with some relative redirects.
Relative redirects did not work with directory redirects and
auto redirects issued by nginx.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 22 Dec 2016 11:58:52 +0300 |
parents | 055cbb52ac1d |
children | 0cdee26605f3 |
comparison
equal
deleted
inserted
replaced
6852:d15172ebb400 | 6853:c85dfd99a2dd |
---|---|
1065 ngx_http_dav_location(ngx_http_request_t *r, u_char *path) | 1065 ngx_http_dav_location(ngx_http_request_t *r, u_char *path) |
1066 { | 1066 { |
1067 u_char *location; | 1067 u_char *location; |
1068 ngx_http_core_loc_conf_t *clcf; | 1068 ngx_http_core_loc_conf_t *clcf; |
1069 | 1069 |
1070 r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t)); | 1070 r->headers_out.location = ngx_list_push(&r->headers_out.headers); |
1071 if (r->headers_out.location == NULL) { | 1071 if (r->headers_out.location == NULL) { |
1072 return NGX_ERROR; | 1072 return NGX_ERROR; |
1073 } | 1073 } |
1074 | 1074 |
1075 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 1075 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
1084 } | 1084 } |
1085 | 1085 |
1086 ngx_memcpy(location, r->uri.data, r->uri.len); | 1086 ngx_memcpy(location, r->uri.data, r->uri.len); |
1087 } | 1087 } |
1088 | 1088 |
1089 /* | 1089 r->headers_out.location->hash = 1; |
1090 * we do not need to set the r->headers_out.location->hash and | 1090 ngx_str_set(&r->headers_out.location->key, "Location"); |
1091 * r->headers_out.location->key fields | |
1092 */ | |
1093 | |
1094 r->headers_out.location->value.len = r->uri.len; | 1091 r->headers_out.location->value.len = r->uri.len; |
1095 r->headers_out.location->value.data = location; | 1092 r->headers_out.location->value.data = location; |
1096 | 1093 |
1097 return NGX_OK; | 1094 return NGX_OK; |
1098 } | 1095 } |