mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Removes forced chartset
Apperantly forcing the charset is not placing any benefits, instead it is cousing problems as documented on #650. This still experimental, just testing against our regression tests. Such feature was added by the commit: 177b5b9c989b0095e5c91b01d205df64e65e6c9e.
This commit is contained in:
parent
efef989ddd
commit
47f5cf92db
@ -586,8 +586,6 @@ ngx_http_modsecurity_load_headers_out(ngx_http_request_t *r)
|
|||||||
ngx_http_modsecurity_ctx_t *ctx;
|
ngx_http_modsecurity_ctx_t *ctx;
|
||||||
char *data;
|
char *data;
|
||||||
request_rec *req;
|
request_rec *req;
|
||||||
u_char *content_type;
|
|
||||||
ngx_uint_t content_type_len;
|
|
||||||
ngx_http_variable_value_t *vv;
|
ngx_http_variable_value_t *vv;
|
||||||
ngx_list_part_t *part;
|
ngx_list_part_t *part;
|
||||||
ngx_table_elt_t *h;
|
ngx_table_elt_t *h;
|
||||||
@ -602,27 +600,6 @@ ngx_http_modsecurity_load_headers_out(ngx_http_request_t *r)
|
|||||||
req->status = r->headers_out.status;
|
req->status = r->headers_out.status;
|
||||||
req->status_line = (char *)ngx_pstrdup0(r->pool, &r->headers_out.status_line);
|
req->status_line = (char *)ngx_pstrdup0(r->pool, &r->headers_out.status_line);
|
||||||
|
|
||||||
if (r->headers_out.charset.len) {
|
|
||||||
|
|
||||||
content_type_len = r->headers_out.content_type.len
|
|
||||||
+ r->headers_out.charset.len
|
|
||||||
+ ngx_strlen("; charset=") + 1;
|
|
||||||
|
|
||||||
content_type = ngx_palloc(r->pool, content_type_len);
|
|
||||||
|
|
||||||
if (content_type == NULL) {
|
|
||||||
return NGX_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngx_snprintf(content_type, content_type_len,
|
|
||||||
"%V; charset=%V%Z",
|
|
||||||
&r->headers_out.content_type,
|
|
||||||
&r->headers_out.charset);
|
|
||||||
|
|
||||||
r->headers_out.content_type.data = content_type;
|
|
||||||
r->headers_out.content_type.len = content_type_len;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* deep copy */
|
/* deep copy */
|
||||||
part = &r->headers_out.headers.part;
|
part = &r->headers_out.headers.part;
|
||||||
h = part->elts;
|
h = part->elts;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user