feature/featuretags, all: add build features, use existing ones in more places
Saves 270 KB. Updates #12614 Change-Id: I4c3fe06d32c49edb3a4bb0758a8617d83f291cf5 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
aa5b2ce83b
commit
c45f8813b4
@@ -10,6 +10,8 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"tailscale.com/feature"
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/logpolicy"
|
||||
)
|
||||
|
||||
@@ -23,6 +25,10 @@ import (
|
||||
// precludes that from working and instead the GUI fails to dial out.
|
||||
// So, go through tailscaled (with a CONNECT request) instead.
|
||||
func (s *Server) handleProxyConnectConn(w http.ResponseWriter, r *http.Request) {
|
||||
if !buildfeatures.HasOutboundProxy {
|
||||
http.Error(w, feature.ErrUnavailable.Error(), http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
ctx := r.Context()
|
||||
if r.Method != "CONNECT" {
|
||||
panic("[unexpected] miswired")
|
||||
|
||||
Reference in New Issue
Block a user