WAF在输出内容时也加入自定义的响应报头

This commit is contained in:
GoEdgeLab
2023-06-11 10:46:20 +08:00
parent 4501e9c15d
commit f7dc03cbfb
23 changed files with 64 additions and 48 deletions

View File

@@ -36,6 +36,7 @@ func (this *PageAction) WillChange() bool {
// Perform the action
func (this *PageAction) Perform(waf *WAF, group *RuleGroup, set *RuleSet, request requests.Request, writer http.ResponseWriter) (continueRequest bool, goNextSet bool) {
request.ProcessResponseHeaders(writer.Header(), this.Status)
writer.Header().Set("Content-Type", "text/html; charset=utf-8")
writer.WriteHeader(this.Status)
_, _ = writer.Write([]byte(request.Format(this.Body)))