diff --git a/CHANGELOG.md b/CHANGELOG.md index 6395910..bfc47ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/pkg/ffuf/response.go b/pkg/ffuf/response.go index 2da127b..7329f39 100644 --- a/pkg/ffuf/response.go +++ b/pkg/ffuf/response.go @@ -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 {