Skip to content

Commit 47f5cf9

Browse files
author
Felipe Zimmerle
committed
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: 177b5b9.
1 parent efef989 commit 47f5cf9

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

nginx/modsecurity/ngx_http_modsecurity.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,6 @@ ngx_http_modsecurity_load_headers_out(ngx_http_request_t *r)
586586
ngx_http_modsecurity_ctx_t *ctx;
587587
char *data;
588588
request_rec *req;
589-
u_char *content_type;
590-
ngx_uint_t content_type_len;
591589
ngx_http_variable_value_t *vv;
592590
ngx_list_part_t *part;
593591
ngx_table_elt_t *h;
@@ -602,27 +600,6 @@ ngx_http_modsecurity_load_headers_out(ngx_http_request_t *r)
602600
req->status = r->headers_out.status;
603601
req->status_line = (char *)ngx_pstrdup0(r->pool, &r->headers_out.status_line);
604602

605-
if (r->headers_out.charset.len) {
606-
607-
content_type_len = r->headers_out.content_type.len
608-
+ r->headers_out.charset.len
609-
+ ngx_strlen("; charset=") + 1;
610-
611-
content_type = ngx_palloc(r->pool, content_type_len);
612-
613-
if (content_type == NULL) {
614-
return NGX_ERROR;
615-
}
616-
617-
ngx_snprintf(content_type, content_type_len,
618-
"%V; charset=%V%Z",
619-
&r->headers_out.content_type,
620-
&r->headers_out.charset);
621-
622-
r->headers_out.content_type.data = content_type;
623-
r->headers_out.content_type.len = content_type_len;
624-
}
625-
626603
/* deep copy */
627604
part = &r->headers_out.headers.part;
628605
h = part->elts;

0 commit comments

Comments
 (0)