Revert "fix: Add directory creation code (#2575)"
This reverts commit fe3060a952.
This commit is contained in:
parent
036752c562
commit
5edee3e6bd
@ -24,7 +24,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const PERM = 0664
|
const PERM = 0664
|
||||||
const DirPERM = 0755
|
|
||||||
|
|
||||||
// FileInfo describes a file.
|
// FileInfo describes a file.
|
||||||
type FileInfo struct {
|
type FileInfo struct {
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
@ -29,13 +28,6 @@ func tusPostHandler() handleFunc {
|
|||||||
if !d.user.Perm.Create || !d.Check(r.URL.Path) {
|
if !d.user.Perm.Create || !d.Check(r.URL.Path) {
|
||||||
return http.StatusForbidden, nil
|
return http.StatusForbidden, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
dirPath := filepath.Dir(r.URL.Path)
|
|
||||||
if _, err := d.user.Fs.Stat(dirPath); os.IsNotExist(err) {
|
|
||||||
if err := d.user.Fs.MkdirAll(dirPath, files.DirPERM); err != nil {
|
|
||||||
return http.StatusInternalServerError, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case err != nil:
|
case err != nil:
|
||||||
return errToStatus(err), err
|
return errToStatus(err), err
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user