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

Method ServeHTTP

client/web/web.go:323–332  ·  view source on GitHub ↗

ServeHTTP processes all requests for the Tailscale web client.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

321
322// ServeHTTP processes all requests for the Tailscale web client.
323func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
324 handler := s.serve
325
326 // if path prefix is defined, strip it from requests.
327 if s.cgiMode && s.pathPrefix != "" {
328 handler = enforcePrefix(s.pathPrefix, handler)
329 }
330
331 handler(w, r)
332}
333
334func (s *Server) serve(w http.ResponseWriter, r *http.Request) {
335 if s.mode == ManageServerMode {

Callers 5

TestPathPrefixFunction · 0.95
csrfProtectMethod · 0.45
serveMethod · 0.45
enforcePrefixFunction · 0.45
TestCSRFProtectFunction · 0.45

Calls 2

enforcePrefixFunction · 0.85
handlerInterface · 0.50

Tested by 2

TestPathPrefixFunction · 0.76
TestCSRFProtectFunction · 0.36