mirror of
https://github.com/rclone/rclone.git
synced 2025-08-18 17:38:52 +02:00
rc: methods marked as AuthRequired need auth unless --rc-no-auth
Methods which can read or mutate external storage will require authorisation - enforce this. This can be overidden by `--rc-no-auth`.
This commit is contained in:
@@ -159,6 +159,12 @@ func (s *Server) handlePost(w http.ResponseWriter, r *http.Request, path string)
|
||||
return
|
||||
}
|
||||
|
||||
// Check to see if it requires authorisation
|
||||
if !s.opt.NoAuth && call.AuthRequired && !s.UsingAuth() {
|
||||
writeError(path, in, w, errors.Errorf("authentication must be set up on the rc server to use %q or the --rc-no-auth flag must be in use", path), http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
// Check to see if it is async or not
|
||||
isAsync, err := in.GetBool("_async")
|
||||
if rc.NotErrParamNotFound(err) {
|
||||
|
Reference in New Issue
Block a user