diff options
| author | Shayne Sweeney <shayne@tailscale.com> | 2022-11-20 12:02:47 -0500 |
|---|---|---|
| committer | Shayne Sweeney <shayne@tailscale.com> | 2022-11-20 12:56:12 -0500 |
| commit | 1ceaabbc7b5ded52d02ae01f9c89a47c8a4db922 (patch) | |
| tree | 7ff484fedcf191e4fa3be292ac201c504db406fc /ipn/ipn_clone.go | |
| parent | 538f431d5d9eda4d40d07f346eca7f9eaf3d9869 (diff) | |
| download | tailscale-shayne/serve_empty_text_handler.tar.xz tailscale-shayne/serve_empty_text_handler.zip | |
cmd/tailscale/cli: allow empty text ("") serveshayne/serve_empty_text_handler
Current behavior is broken. `tailscale serve text / ""` returns no error
and shows up in `tailscale serve status` but requests return a 500
"empty handler".
The commit changes the handler field `Text` to type of `*string`.
Closes #6405
Signed-off-by: Shayne Sweeney <shayne@tailscale.com>
Diffstat (limited to 'ipn/ipn_clone.go')
| -rw-r--r-- | ipn/ipn_clone.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ipn/ipn_clone.go b/ipn/ipn_clone.go index 8971b7b90..d0ae68069 100644 --- a/ipn/ipn_clone.go +++ b/ipn/ipn_clone.go @@ -118,6 +118,10 @@ func (src *HTTPHandler) Clone() *HTTPHandler { } dst := new(HTTPHandler) *dst = *src + if dst.Text != nil { + dst.Text = new(string) + *dst.Text = *src.Text + } return dst } @@ -125,7 +129,7 @@ func (src *HTTPHandler) Clone() *HTTPHandler { var _HTTPHandlerCloneNeedsRegeneration = HTTPHandler(struct { Path string Proxy string - Text string + Text *string }{}) // Clone makes a deep copy of WebServerConfig. |
