Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/net/http: implement rwUnwrapper #2775

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

rarguelloF
Copy link
Contributor

@rarguelloF rarguelloF commented Jul 8, 2024

What does this PR do?

Fixes #2674

Implement the rwUnwrapper interface for the wrapped http.ResponseWriter we return in this package.

Motivation

The rwUnwrapper interface is checked and used internally in the standard library: https://github.com/golang/go/blob/6d89b38ed86e0bfa0ddaba08dc4071e6bb300eea/src/net/http/responsecontroller.go#L42-L44

This approach makes unnecessary to implement all the possible http.ResponseWriter optional methods in the wrapped type.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Jul 8, 2024
@pr-commenter
Copy link

pr-commenter bot commented Jul 8, 2024

Benchmarks

Benchmark execution time: 2024-07-08 16:06:22

Comparing candidate commit f751181 in PR branch rarguelloF/AIDM-199/fix-net-http-rw-timeouts with baseline commit dc5c6a9 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 47 metrics, 0 unstable metrics.

darccio

This comment was marked as duplicate.

@rarguelloF rarguelloF marked this pull request as ready for review July 8, 2024 13:27
@rarguelloF rarguelloF requested review from a team as code owners July 8, 2024 13:27
@rarguelloF rarguelloF enabled auto-merge (squash) July 8, 2024 15:43
auto-merge was automatically disabled July 8, 2024 15:49

Pull Request is not mergeable

@rarguelloF rarguelloF merged commit 79fd68c into main Jul 8, 2024
164 checks passed
@rarguelloF rarguelloF deleted the rarguelloF/AIDM-199/fix-net-http-rw-timeouts branch July 8, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Support for http.ResponseController timeouts in WrapHandler
2 participants