Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [5.17.2] - 2023-05-09
### Fixed
- Prematurely closing http.Response Body before error with it can be intercepted for ErrUnexpectedResponse.

## [5.17.1] - 2023-05-09
### Fixed
- ErrRetryableStatusCode passing the *http.Response to have access to not only the status code but headers etc. related to retrying.
Expand Down Expand Up @@ -42,7 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added `timext.NanoTime` for fast low level monotonic time with nanosecond precision.

[Unreleased]: https://github.com/go-playground/pkg/compare/v5.17.1...HEAD
[Unreleased]: https://github.com/go-playground/pkg/compare/v5.17.2...HEAD
[5.17.2]: https://github.com/go-playground/pkg/compare/v5.17.1..v5.17.2
[5.17.1]: https://github.com/go-playground/pkg/compare/v5.17.0...v5.17.1
[5.17.0]: https://github.com/go-playground/pkg/compare/v5.16.0...v5.17.0
[5.16.0]: https://github.com/go-playground/pkg/compare/v5.15.2...v5.16.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pkg

![Project status](https://img.shields.io/badge/version-5.17.1-green.svg)
![Project status](https://img.shields.io/badge/version-5.17.2-green.svg)
[![Lint & Test](https://github.com/go-playground/pkg/actions/workflows/go.yml/badge.svg)](https://github.com/go-playground/pkg/actions/workflows/go.yml)
[![Coverage Status](https://coveralls.io/repos/github/go-playground/pkg/badge.svg?branch=master)](https://coveralls.io/github/go-playground/pkg?branch=master)
[![GoDoc](https://godoc.org/github.com/go-playground/pkg?status.svg)](https://pkg.go.dev/mod/github.com/go-playground/pkg/v5)
Expand Down
2 changes: 1 addition & 1 deletion net/http/retryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ func DoRetryable[T any](ctx context.Context, isRetryableFn errorsext.IsRetryable
return resultext.Err[T, error](result.Err())
}
resp := result.Unwrap()
defer resp.Body.Close()

if resp.StatusCode != expectedResponseCode {
return resultext.Err[T, error](ErrUnexpectedResponse{Response: resp})
}
defer resp.Body.Close()

data, err := DecodeResponse[T](resp, maxMemory)
if err != nil {
Expand Down