fix
parent
c0f751e084
commit
19271725f5
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue