mirror of
https://github.com/chainreactors/spray.git
synced 2026-10-29 11:50:52 +00:00
修复某些情况下statuscode无法正确读取的bug
This commit is contained in:
1 parent
755afa8a5f
commit
90cecab020
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user