fixed http status response for javascript redirects

This commit is contained in:
Kuba Gretzky 2023-07-26 19:22:49 +02:00
parent fa3e25b86b
commit 19d3c0f8c6

View File

@ -1051,7 +1051,7 @@ func (p *HttpProxy) blockRequest(req *http.Request) (*http.Request, *http.Respon
func (p *HttpProxy) javascriptRedirect(req *http.Request, rurl string) (*http.Request, *http.Response) {
body := fmt.Sprintf("<html><head><meta name='referrer' content='no-referrer'><script>top.location.href='%s';</script></head><body></body></html>", rurl)
resp := goproxy.NewResponse(req, "text/html", http.StatusFound, body)
resp := goproxy.NewResponse(req, "text/html", http.StatusOK, body)
if resp != nil {
return req, resp
}