1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

rc: add NeedsResponse for rc calls

This commit is contained in:
Chaitanya Bankanhal
2020-07-27 23:31:35 +05:30
committed by Nick Craig-Wood
parent 4884bee8ba
commit 1cae4152f9
3 changed files with 29 additions and 7 deletions

View File

@@ -265,6 +265,10 @@ func (s *Server) handlePost(w http.ResponseWriter, r *http.Request, path string)
in["_request"] = r
}
if call.NeedsResponse {
in["_response"] = &w
}
// Check to see if it is async or not
isAsync, err := in.GetBool("_async")
if rc.NotErrParamNotFound(err) {