Fix crash with 3xx requests without location header (#265)
Co-authored-by: Joona Hoikkala <joohoi@io.fi>
This commit is contained in:
parent
9bb613050e
commit
bef2dc04ed
@ -14,6 +14,7 @@
|
||||
- Fixed HTML report to display select/combo-box for rows per page (and increased default from 10 to 250 rows).
|
||||
- Added Host information to JSON output file
|
||||
- Fixed request method when supplying request file
|
||||
- Fixed crash with 3XX responses that weren't redirects (304 Not Modified, 300 Multiple Choices etc)
|
||||
|
||||
- v1.0.2
|
||||
- Changed
|
||||
|
||||
@ -24,7 +24,11 @@ func (resp *Response) GetRedirectLocation(absolute bool) string {
|
||||
|
||||
redirectLocation := ""
|
||||
if resp.StatusCode >= 300 && resp.StatusCode <= 399 {
|
||||
redirectLocation = resp.Headers["Location"][0]
|
||||
if loc, ok := resp.Headers["Location"]; ok {
|
||||
if len(loc) > 0 {
|
||||
redirectLocation = loc[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if absolute {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user