mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-20 21:51:42 +00:00
cmd/tailscale: only send file basename in push
Fixes #1640 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
f845aae761
commit
11780a4503
@ -16,6 +16,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
@ -98,7 +99,7 @@ func runPush(ctx context.Context, args []string) error {
|
|||||||
contentLength = fi.Size()
|
contentLength = fi.Size()
|
||||||
fileContents = io.LimitReader(f, contentLength)
|
fileContents = io.LimitReader(f, contentLength)
|
||||||
if name == "" {
|
if name == "" {
|
||||||
name = fileArg
|
name = filepath.Base(fileArg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if slow, _ := strconv.ParseBool(os.Getenv("TS_DEBUG_SLOW_PUSH")); slow {
|
if slow, _ := strconv.ParseBool(os.Getenv("TS_DEBUG_SLOW_PUSH")); slow {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user