MCPcopy Index your code
hub / github.com/tailscale/tailscale / brokenMITMHandler

Function brokenMITMHandler

control/controlhttp/http_test.go:562–572  ·  view source on GitHub ↗
(clock tstime.Clock)

Source from the content-addressed store, hash-verified

560}
561
562func brokenMITMHandler(clock tstime.Clock) http.HandlerFunc {
563 return func(w http.ResponseWriter, r *http.Request) {
564 w.Header().Set("Upgrade", controlhttpcommon.UpgradeHeaderValue)
565 w.Header().Set("Connection", "upgrade")
566 w.WriteHeader(http.StatusSwitchingProtocols)
567 w.(http.Flusher).Flush()
568 // Advance the clock to trigger HTTPs fallback.
569 clock.Now()
570 <-r.Context().Done()
571 }
572}
573
574func TestDialPlan(t *testing.T) {
575 testCases := []struct {

Callers 2

testControlHTTPFunction · 0.85
runDialPlanTestFunction · 0.85

Calls 7

SetMethod · 0.65
NowMethod · 0.65
DoneMethod · 0.65
ContextMethod · 0.65
HeaderMethod · 0.45
WriteHeaderMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…