summaryrefslogtreecommitdiffhomepage
path: root/ipn/serve.go
diff options
context:
space:
mode:
authorShayne Sweeney <shayne@tailscale.com>2022-11-20 12:02:47 -0500
committerShayne Sweeney <shayne@tailscale.com>2022-11-20 12:56:12 -0500
commit1ceaabbc7b5ded52d02ae01f9c89a47c8a4db922 (patch)
tree7ff484fedcf191e4fa3be292ac201c504db406fc /ipn/serve.go
parent538f431d5d9eda4d40d07f346eca7f9eaf3d9869 (diff)
downloadtailscale-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/serve.go')
-rw-r--r--ipn/serve.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipn/serve.go b/ipn/serve.go
index 93d6b077e..2e38fcd5d 100644
--- a/ipn/serve.go
+++ b/ipn/serve.go
@@ -65,7 +65,7 @@ type HTTPHandler struct {
Path string `json:",omitempty"` // absolute path to directory or file to serve
Proxy string `json:",omitempty"` // http://localhost:3000/, localhost:3030, 3030
- Text string `json:",omitempty"` // plaintext to serve (primarily for testing)
+ Text *string `json:",omitempty"` // plaintext to serve (primarily for testing)
// TODO(bradfitz): bool to not enumerate directories? TTL on mapping for
// temporary ones? Error codes? Redirects?