fix
parent
c0f751e084
commit
19271725f5
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -147,8 +148,12 @@ func tusPostHandler() handleFunc {
|
||||||
// Enables the user to utilize the PATCH endpoint for uploading file data
|
// Enables the user to utilize the PATCH endpoint for uploading file data
|
||||||
registerUpload(file.RealPath(), uploadLength)
|
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
|
return http.StatusCreated, nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue