Skip to content

net/http: add Transport.RoundTrip enforcement hook - #68

Merged
bradfitz merged 1 commit into
tailscale.go1.21from
bradfitz/http_enforce
Jul 23, 2023
Merged

bradfitz merged 1 commit into
tailscale.go1.21from
bradfitz/http_enforce

Conversation

@bradfitz

@bradfitz bradfitz commented Jul 23, 2023 •

Copy link
Copy Markdown
Member

net/http: add enforcement hook to Transport.RoundTrip, like our net ones

Updates #55
Updates https://github.com/tailscale/corp/issues/12702

@bradfitz
bradfitz changed the base branch from tailscale.go1.20 to tailscale.go1.21 July 23, 2023 03:13
@bradfitz
bradfitz requested review from maisem and phirework July 23, 2023 03:13
Comment thread src/net/http/tailscale.go
Comment thread src/net/http/tailscale.go
if f == nil {
panic("nil func")
}
if roundTripEnforcer != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's useful to be able to set this back to nil after a test runs. I've run into that issue for the other hooks that we have.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's meant to be installed exactly once in init. If we want per-test control, we provide that ourselves in our installed hook.

The other two hooks are like this too.

Updates #55
Updates tailscale/corp#12702

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz
bradfitz force-pushed the bradfitz/http_enforce branch from aee11cc to 1ecb1d6 Compare July 23, 2023 03:30
@bradfitz
bradfitz merged commit a96a9ed into tailscale.go1.21 Jul 23, 2023
@bradfitz
bradfitz deleted the bradfitz/http_enforce branch July 23, 2023 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants