From 18eada499b5712a317d2dba15e0dfd51524334d1 Mon Sep 17 00:00:00 2001 From: Andrea Gottardo Date: Wed, 9 Oct 2024 18:47:07 -0700 Subject: [PATCH] drive/driveimpl: do not serve WebDAV on tvOS 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 --- drive/driveimpl/local_impl.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 @@ "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)