Fix panic when when nuclei server is shutdown (#3139)

This commit is contained in:
Jaideep Khandelwal
2023-01-03 23:56:33 +05:30
committed by GitHub
parent a6a26ec026
commit eabd4954cf

View File

@@ -37,7 +37,7 @@ const (
// HTTPErrorRetryPolicy is to retry for HTTPCodes >= 500.
func HTTPErrorRetryPolicy() func(ctx context.Context, resp *http.Response, err error) (bool, error) {
return func(ctx context.Context, resp *http.Response, err error) (bool, error) {
if resp.StatusCode >= http.StatusInternalServerError {
if resp != nil && resp.StatusCode >= http.StatusInternalServerError {
return true, errors.New(resp.Status)
}
return retryablehttp.CheckRecoverableErrors(ctx, resp, err)