feat: some more cleaning
License: MIT Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
parent
38bcc3b992
commit
85769b309e
@ -64,11 +64,6 @@ func (e *env) resourceGetHandler(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if !user.Perm.Modify && file.Type == "text" {
|
||||
// TODO: move to detet file type
|
||||
file.Type = "textImmutable"
|
||||
}
|
||||
|
||||
if checksum := r.URL.Query().Get("checksum"); checksum != "" {
|
||||
err = e.Checksum(file,user, checksum)
|
||||
if err == lib.ErrInvalidOption {
|
||||
|
||||
@ -350,6 +350,10 @@ func (f *FileBrowser) detectType(file *File, user *User) error {
|
||||
file.Content = string(content)
|
||||
}
|
||||
|
||||
if !user.Perm.Modify && file.Type == "text" {
|
||||
file.Type = "textImmutable"
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -13,8 +13,7 @@ type searchOptions struct {
|
||||
Terms []string
|
||||
}
|
||||
|
||||
// TODO: create filtering afero backend
|
||||
// used filepath.SkipDir to skip
|
||||
// TODO: move to FIle Browser and also check for IsAllowed
|
||||
|
||||
// Search searches for a query in a fs.
|
||||
func Search(fs afero.Fs, scope string, query string, found func(path string, f os.FileInfo) error) error {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user