优化location的处理, 某些应用可能会使用小写

This commit is contained in:
M09Ic 2023-02-07 18:37:19 +08:00
parent f185dd80e9
commit ae746b9e67

View File

@ -43,7 +43,11 @@ func NewBaseline(u, host string, resp *ihttp.Response) *Baseline {
bl.ContentType = "other"
}
bl.Raw = append(bl.Header, bl.Body...)
bl.RedirectURL = resp.GetHeader("Location")
if r := resp.GetHeader("Location"); r != "" {
bl.RedirectURL = r
} else {
bl.RedirectURL = resp.GetHeader("location")
}
bl.Dir = bl.IsDir()
uu, err := url.Parse(u)