(clock tstime.Clock)
| 560 | } |
| 561 | |
| 562 | func 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 | |
| 574 | func TestDialPlan(t *testing.T) { |
| 575 | testCases := []struct { |