diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2025-06-19 10:29:32 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@tailscale.com> | 2025-06-19 10:29:32 -0700 |
| commit | f6a1b149df3ff08408a0ad0b2d41f2a7a85200cd (patch) | |
| tree | 0a899dc30b1410b249a0da526f21545f72a8f9ae /derp/derphttp/derphttp_server.go | |
| parent | 583f740c0b583081b0c1a39f92e349c49c0c4a41 (diff) | |
| download | tailscale-bradfitz/tinyderpclient.tar.xz tailscale-bradfitz/tinyderpclient.zip | |
Change-Id: Idcc360abdcc723fcf5ccef9d539056c68b7aa2b2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'derp/derphttp/derphttp_server.go')
| -rw-r--r-- | derp/derphttp/derphttp_server.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/derp/derphttp/derphttp_server.go b/derp/derphttp/derphttp_server.go index 50aba774a..ea2b9ea8c 100644 --- a/derp/derphttp/derphttp_server.go +++ b/derp/derphttp/derphttp_server.go @@ -1,6 +1,8 @@ // Copyright (c) Tailscale Inc & AUTHORS // SPDX-License-Identifier: BSD-3-Clause +//go:build !ts_omit_derpserver + package derphttp import ( @@ -12,12 +14,6 @@ import ( "tailscale.com/derp" ) -// fastStartHeader is the header (with value "1") that signals to the HTTP -// server that the DERP HTTP client does not want the HTTP 101 response -// headers and it will begin writing & reading the DERP protocol immediately -// following its HTTP request. -const fastStartHeader = "Derp-Fast-Start" - // Handler returns an http.Handler to be mounted at /derp, serving s. func Handler(s *derp.Server) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -42,7 +38,7 @@ func Handler(s *derp.Server) http.Handler { return } - fastStart := r.Header.Get(fastStartHeader) == "1" + fastStart := r.Header.Get(derp.FastStartHeader) == "1" h, ok := w.(http.Hijacker) if !ok { |
