(w http.ResponseWriter, r *http.Request)
| 513 | } |
| 514 | |
| 515 | func (h *localSecHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 516 | if r.Header.Get("Sec-Tailscale") != "localapi" { |
| 517 | w.WriteHeader(403) |
| 518 | io.WriteString(w, "missing 'Sec-Tailscale: localapi' header") |
| 519 | return |
| 520 | } |
| 521 | h.h.ServeHTTP(w, r) |
| 522 | } |
| 523 | |
| 524 | // Start connects the server to the tailnet. |
| 525 | // Optional: any calls to Dial/Listen will also call Start. |