summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrea Gottardo <andrea@gottardo.me>2024-10-09 18:47:07 -0700
committerAndrea Gottardo <andrea@gottardo.me>2024-10-09 18:47:07 -0700
commit18eada499b5712a317d2dba15e0dfd51524334d1 (patch)
tree30fb44354cb466cd28a97306843460fc32899b41
parentfb420be1769426c96af8a5e58adcf6562e3d51a7 (diff)
downloadtailscale-13765-taildrive-server-unexpectedly-starts-on-apple-tv.tar.xz
tailscale-13765-taildrive-server-unexpectedly-starts-on-apple-tv.zip
drive/driveimpl: do not serve WebDAV on tvOS13765-taildrive-server-unexpectedly-starts-on-apple-tv
Fixes tailscale/tailscale#13765 There is no need to serve a local filesystem on tvOS, given that there is no filesystem there. Disable it with a platform check. There are likely more platforms that we can exclude. Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
-rw-r--r--drive/driveimpl/local_impl.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/drive/driveimpl/local_impl.go b/drive/driveimpl/local_impl.go
index 8cdf60179..31b1e04dc 100644
--- a/drive/driveimpl/local_impl.go
+++ b/drive/driveimpl/local_impl.go
@@ -14,6 +14,7 @@ import (
"tailscale.com/drive/driveimpl/compositedav"
"tailscale.com/drive/driveimpl/dirfs"
"tailscale.com/types/logger"
+ "tailscale.com/version"
)
const (
@@ -55,6 +56,11 @@ type FileSystemForLocal struct {
}
func (s *FileSystemForLocal) startServing() {
+ if version.IsAppleTV() {
+ s.logf("won't serve taildrive on Apple TV")
+ return
+ }
+
hs := &http.Server{Handler: s.h}
go func() {
err := hs.Serve(s.listener)