pull/5302/head
Henrique Dias 2025-07-17 18:06:40 +02:00
parent c0f751e084
commit 19271725f5
No known key found for this signature in database
1 changed files with 6 additions and 1 deletions

View File

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