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 <andrea@gottardo.me>
This commit is contained in:
Andrea Gottardo 2024-10-09 18:47:07 -07:00
parent fb420be176
commit 18eada499b

View File

@ -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)