mirror of
https://github.com/chainreactors/spray.git
synced 2025-09-15 19:50:18 +00:00
修复某些情况下statuscode无法正确读取的bug
This commit is contained in:
parent
d95b0315ec
commit
1895496e0b
@ -21,7 +21,7 @@ func (e ErrorType) Error() string {
|
|||||||
case ErrRequestFailed:
|
case ErrRequestFailed:
|
||||||
return "request failed"
|
return "request failed"
|
||||||
case ErrWaf:
|
case ErrWaf:
|
||||||
return "maybe ban of waf"
|
return "maybe banned by waf"
|
||||||
case ErrRedirect:
|
case ErrRedirect:
|
||||||
return "duplicate redirect url"
|
return "duplicate redirect url"
|
||||||
case ErrCompareFailed:
|
case ErrCompareFailed:
|
||||||
|
@ -24,7 +24,7 @@ func NewBaseline(u, host string, resp *ihttp.Response) *Baseline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bl.Body = resp.Body()
|
bl.Body = resp.Body()
|
||||||
bl.BodyLength = resp.ContentLength()
|
bl.BodyLength = len(resp.Body())
|
||||||
bl.Header = resp.Header()
|
bl.Header = resp.Header()
|
||||||
bl.HeaderLength = len(bl.Header)
|
bl.HeaderLength = len(bl.Header)
|
||||||
bl.RedirectURL = resp.GetHeader("Location")
|
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.Body = resp.Body()
|
||||||
bl.BodyLength = resp.ContentLength()
|
bl.BodyLength = len(bl.Body)
|
||||||
bl.RedirectURL = string(resp.GetHeader("Location"))
|
bl.RedirectURL = string(resp.GetHeader("Location"))
|
||||||
|
|
||||||
return bl
|
return bl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user