diff options
| author | fengweihao <[email protected]> | 2021-12-13 15:59:59 +0800 |
|---|---|---|
| committer | fengweihao <[email protected]> | 2021-12-13 15:59:59 +0800 |
| commit | 3e3dedadcd1eee14ba4bf38f08669250b750f1f7 (patch) | |
| tree | 7b86a44e84a259f48cc7880c788f465196bd006a | |
| parent | 16891fa7fbdf3472a10b74b1bd28b838e4e5cfff (diff) | |
TSG-8967 修复facebook的评论内容无法删除v4.5.29-20211214
| -rw-r--r-- | plugin/business/pangu-http/src/pangu_http.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp index c99a85e..8ce3ccc 100644 --- a/plugin/business/pangu-http/src/pangu_http.cpp +++ b/plugin/business/pangu-http/src/pangu_http.cpp @@ -188,7 +188,7 @@ static void pangu_http_stat_init(struct pangu_rt * pangu_runtime) spec[STAT_ACTION_HIJACK_SZ]="hijk_bytes"; spec[STAT_ACTION_INSERT]="intcp_ins_num"; spec[STAT_ACTION_INSERT_SZ]="ins_bytes"; - spec[STAT_ACTION_EDIT_ELEMENT]="intcp_elem_num"; + spec[STAT_ACTION_EDIT_ELEMENT]="intcp_edit_elem_num"; spec[STAT_ACTION_WHITELSIT]="intcp_allow_num"; spec[STAT_SUSPENDING]="suspending"; @@ -559,6 +559,10 @@ void policy_action_param_free_cb(int table_id, const struct Maat_rule_t* rule, c FREE(&(param->repl_rule[i].replace_with)); } + if (param->elem_rule) + FREE(&(param->elem_rule)); + if (param->repl_rule) + FREE(&(param->repl_rule)); if (param->message) FREE(&(param->message)); if (param->position) @@ -2139,7 +2143,7 @@ void http_element(const struct tfe_stream * stream, const struct tfe_http_sessio { rewrite_sz = execute_edit_element_rule(__http_body, __http_body_len, edit_ctx->item, edit_ctx->n_item, &rewrite_buff, 0); } - if(in_resp_spec->content_type != NULL && strcasestr(in_resp_spec->content_type, "json")) + if(in_resp_spec->content_type != NULL && (strcasestr(in_resp_spec->content_type, "json") || strcasestr(in_resp_spec->content_type, "text/javascript"))) { rewrite_sz = execute_edit_element_rule(__http_body, __http_body_len, edit_ctx->item, edit_ctx->n_item, &rewrite_buff, 1); } |
