(path string)
| 45 | } |
| 46 | |
| 47 | func (n Response) AbsoluteURL(path string) string { |
| 48 | if strings.HasPrefix(path, "#") { |
| 49 | return "" |
| 50 | } |
| 51 | |
| 52 | absURL, err := n.Resp.Request.URL.Parse(path) |
| 53 | if err != nil { |
| 54 | return "" |
| 55 | } |
| 56 | absURL.Fragment = "" |
| 57 | if absURL.Scheme == "//" { |
| 58 | absURL.Scheme = n.Resp.Request.URL.Scheme |
| 59 | } |
| 60 | final := absURL.String() |
| 61 | return final |
| 62 | } |
| 63 | |
| 64 | func (n Response) IsRedirect() bool { |
| 65 | return n.StatusCode >= 300 && n.StatusCode <= 399 |
no test coverage detected