From 19271725f55d8ffb83704e86341dc26cc7dd7334 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 17 Jul 2025 18:06:40 +0200 Subject: [PATCH] fix --- http/tus_handlers.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/http/tus_handlers.go b/http/tus_handlers.go index 9fd1780a..f7ed1718 100644 --- a/http/tus_handlers.go +++ b/http/tus_handlers.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "net/http" + "net/url" "os" "path/filepath" "strconv" @@ -147,8 +148,12 @@ func tusPostHandler() handleFunc { // Enables the user to utilize the PATCH endpoint for uploading file data registerUpload(file.RealPath(), uploadLength) - w.Header().Set("Location", "/api/tus"+r.URL.Path) + path, err := url.JoinPath("/", d.server.BaseURL, "/api/tus", r.URL.Path) + if err != nil { + return http.StatusBadRequest, fmt.Errorf("invalid path: %w", err) + } + w.Header().Set("Location", path) return http.StatusCreated, nil }) }