Skip to content

Commit

Permalink
fix: body could have been nil
Browse files Browse the repository at this point in the history
  • Loading branch information
d-led committed Sep 17, 2024
1 parent 169ec84 commit 2bc2bac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions infrastructure/url_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ func (c *URLCheckerClient) tryHeadRequestAsBrowserIfForbidden(ctx context.Contex

func (c *URLCheckerClient) limitedBody(response *resty.Response) string {
body := response.RawBody()
if body == nil {
return ""
}
defer body.Close()
return safelyTrimmedStream(body, c.settings.LimitBodyToNBytes)
}
Expand Down

0 comments on commit 2bc2bac

Please sign in to comment.