fix backend lint

This commit is contained in:
Oleg Lobanov 2023-07-28 15:19:52 +02:00
parent b2cb757d36
commit 4897acf92e
No known key found for this signature in database
2 changed files with 8 additions and 4 deletions

View File

@ -23,6 +23,8 @@ import (
"github.com/filebrowser/filebrowser/v2/rules"
)
const PERM = 0664
// FileInfo describes a file.
type FileInfo struct {
*Listing

View File

@ -3,12 +3,14 @@ package http
import (
"errors"
"fmt"
"github.com/filebrowser/filebrowser/v2/files"
"github.com/spf13/afero"
"io"
"net/http"
"os"
"strconv"
"github.com/spf13/afero"
"github.com/filebrowser/filebrowser/v2/files"
)
func tusPostHandler() handleFunc {
@ -42,7 +44,7 @@ func tusPostHandler() handleFunc {
}
}
openFile, err := d.user.Fs.OpenFile(r.URL.Path, fileFlags, 0664)
openFile, err := d.user.Fs.OpenFile(r.URL.Path, fileFlags, files.PERM)
if err != nil {
return errToStatus(err), err
}
@ -121,7 +123,7 @@ func tusPatchHandler() handleFunc {
)
}
openFile, err := d.user.Fs.OpenFile(r.URL.Path, os.O_WRONLY|os.O_APPEND, 0664)
openFile, err := d.user.Fs.OpenFile(r.URL.Path, os.O_WRONLY|os.O_APPEND, files.PERM)
if err != nil {
return http.StatusInternalServerError, fmt.Errorf("could not open file: %v", err)
}