Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2a43589

Browse files
author
Felipe Zimmerle
committed
nginx: Removes problematic performance improvement
In an attempt to boost the performance the headers were being checked in twodifferent situations, the first if SecResponseBodyAccess was Off and in asecond situation if SecResponseBodyAccess was set to On. This makes sensehowever functionalities such as content injection demands the body even ifSecResponseBodyAccess was not enabled. This patch removes the first scenario,leaving just the second one. After this modification the following regressiontests started to pass:from: regression/action/10-append-prepend.t 1) action - append content: passed 2) action - prepend content: passed
1 parent21e25c5 commit2a43589

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

‎nginx/modsecurity/ngx_http_modsecurity.c‎

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,6 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r) {
10741074
ngx_http_modsecurity_ctx_t*ctx;
10751075
constchar*location;
10761076
ngx_table_elt_t*h;
1077-
ngx_int_trc;
1078-
10791077

10801078
cf=ngx_http_get_module_loc_conf(r,ngx_http_modsecurity);
10811079
ctx=ngx_http_get_module_ctx(r,ngx_http_modsecurity);
@@ -1112,33 +1110,6 @@ ngx_http_modsecurity_header_filter(ngx_http_request_t *r) {
11121110

11131111
ngx_log_debug0(NGX_LOG_DEBUG_HTTP,r->connection->log,0,"modSecurity: header filter");
11141112

1115-
/* header only or SecResponseBodyAccess off */
1116-
if (r->header_only|| (!modsecIsResponseBodyAccessEnabled(ctx->req)) ) {
1117-
1118-
ctx->complete=1;
1119-
1120-
if (ngx_http_modsecurity_load_headers_in(r)!=NGX_OK
1121-
||ngx_http_modsecurity_load_headers_out(r)!=NGX_OK) {
1122-
1123-
returnNGX_HTTP_INTERNAL_SERVER_ERROR;
1124-
}
1125-
1126-
rc=ngx_http_modsecurity_status(r,modsecProcessResponse(ctx->req));
1127-
1128-
if (rc!=NGX_DECLINED) {
1129-
returnngx_http_filter_finalize_request(r,&ngx_http_modsecurity,rc);
1130-
}
1131-
1132-
if (ngx_http_modsecurity_save_headers_in(r)!=NGX_OK
1133-
||ngx_http_modsecurity_save_headers_out(r)!=NGX_OK) {
1134-
returnngx_http_filter_finalize_request(r,&ngx_http_modsecurity,NGX_HTTP_INTERNAL_SERVER_ERROR);
1135-
}
1136-
1137-
returnngx_http_next_header_filter(r);
1138-
}
1139-
1140-
/* SecResponseBodyAccess on, process rules in body filter */
1141-
11421113
r->filter_need_in_memory=1;
11431114
returnNGX_OK;
11441115
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp