From 11780a45030d651857f7ab9115dbb8c0d88214d6 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 22 Apr 2021 09:33:59 -0700 Subject: [PATCH] cmd/tailscale: only send file basename in push Fixes #1640 Signed-off-by: Brad Fitzpatrick --- cmd/tailscale/cli/push.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tailscale/cli/push.go b/cmd/tailscale/cli/push.go index d1e095e9e..721ca2e6d 100644 --- a/cmd/tailscale/cli/push.go +++ b/cmd/tailscale/cli/push.go @@ -16,6 +16,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strconv" "time" "unicode/utf8" @@ -98,7 +99,7 @@ func runPush(ctx context.Context, args []string) error { contentLength = fi.Size() fileContents = io.LimitReader(f, contentLength) if name == "" { - name = fileArg + name = filepath.Base(fileArg) } if slow, _ := strconv.ParseBool(os.Getenv("TS_DEBUG_SLOW_PUSH")); slow {