chore: fix golangci-lint errors

This commit is contained in:
Oleg Lobanov
2024-04-01 18:24:06 +02:00
parent d194d71293
commit ae0af1f996
54 changed files with 452 additions and 475 deletions

View File

@@ -15,7 +15,7 @@ var subtitleHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *d
return http.StatusAccepted, nil
}
file, err := files.NewFileInfo(files.FileOptions{
file, err := files.NewFileInfo(&files.FileOptions{
Fs: d.user.Fs,
Path: r.URL.Path,
Modify: d.user.Perm.Modify,
@@ -27,12 +27,6 @@ var subtitleHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *d
return errToStatus(err), err
}
// TODO: no idea what this does
// if files.IsNamedPipe(file.Mode) {
// setContentDisposition(w, r, file)
// return 0, nil
// }
if file.IsDir {
return http.StatusBadRequest, nil
}
@@ -63,7 +57,6 @@ func subtitleFileHandler(w http.ResponseWriter, r *http.Request, file *files.Fil
return http.StatusInternalServerError, err
}
// TODO: not sure if this is needed here
setContentDisposition(w, r, file)
w.Header().Add("Content-Security-Policy", `script-src 'none';`)
w.Header().Set("Cache-Control", "private")