aboutsummaryrefslogtreecommitdiff
path: root/weed/server/filer_server.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/server/filer_server.go')
-rw-r--r--weed/server/filer_server.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go
index a76994b89..d35485ad2 100644
--- a/weed/server/filer_server.go
+++ b/weed/server/filer_server.go
@@ -79,6 +79,7 @@ type FilerOption struct {
DiskType string
AllowedOrigins []string
ExposeDirectoryData bool
+ TusPath string
}
type FilerServer struct {
@@ -196,7 +197,13 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
if !option.DisableHttp {
defaultMux.HandleFunc("/healthz", requestIDMiddleware(fs.filerHealthzHandler))
// TUS resumable upload protocol handler
- defaultMux.HandleFunc("/.tus/", fs.filerGuard.WhiteList(requestIDMiddleware(fs.tusHandler)))
+ if option.TusPath != "" {
+ tusPath := option.TusPath
+ if !strings.HasSuffix(tusPath, "/") {
+ tusPath += "/"
+ }
+ defaultMux.HandleFunc(tusPath, fs.filerGuard.WhiteList(requestIDMiddleware(fs.tusHandler)))
+ }
defaultMux.HandleFunc("/", fs.filerGuard.WhiteList(requestIDMiddleware(fs.filerHandler)))
}
if defaultMux != readonlyMux {