修复某些情况下statuscode无法正确读取的bug

This commit is contained in:
M09Ic committed 2022-11-17 16:33:56 +08:00
1 parent 755afa8a5f
commit 90cecab020
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ func (e ErrorType) Error() string {
case ErrRequestFailed:
return "request failed"
case ErrWaf:
return "maybe ban of waf"
return "maybe banned by waf"
case ErrRedirect:
return "duplicate redirect url"
case ErrCompareFailed:
+2 -2
View File
@@ -24,7 +24,7 @@ func NewBaseline(u, host string, resp *ihttp.Response) *Baseline {
}
bl.Body = resp.Body()
bl.BodyLength = resp.ContentLength()
bl.BodyLength = len(resp.Body())
bl.Header = resp.Header()
bl.HeaderLength = len(bl.Header)
bl.RedirectURL = resp.GetHeader("Location")
@@ -50,7 +50,7 @@ func NewInvalidBaseline(u, host string, resp *ihttp.Response, reason string) *Ba
}
bl.Body = resp.Body()
bl.BodyLength = resp.ContentLength()
bl.BodyLength = len(bl.Body)
bl.RedirectURL = string(resp.GetHeader("Location"))
return bl