http response body位置命中阻断规则时,不调用tfe_http_session_allow_write。
This commit is contained in:
@@ -863,9 +863,11 @@ static void http_reject(const struct tfe_http_session * session, enum tfe_http_e
|
||||
ctx->enforce_rules[0].config_id, ctx->enforce_para);
|
||||
|
||||
ctx->action = PG_ACTION_NONE;
|
||||
goto error_out;
|
||||
return;
|
||||
}
|
||||
|
||||
if(events & EV_HTTP_RESP_HDR || tfe_http_in_request(events))
|
||||
{
|
||||
to_write_sess = tfe_http_session_allow_write(session);
|
||||
response = tfe_http_session_response_create(to_write_sess, resp_code);
|
||||
|
||||
@@ -878,10 +880,14 @@ static void http_reject(const struct tfe_http_session * session, enum tfe_http_e
|
||||
tfe_http_half_append_body(response, NULL, 0, 0);
|
||||
tfe_http_session_response_set(to_write_sess, response);
|
||||
tfe_http_session_detach(session);
|
||||
|
||||
error_out:
|
||||
html_free(&page_buff);
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: close http session.
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void http_redirect(const struct tfe_http_session * session, enum tfe_http_event events,
|
||||
struct pangu_http_ctx * ctx)
|
||||
|
||||
Reference in New Issue
Block a user