From 6308153ae7179b683390a8741d8750aa43ae062d Mon Sep 17 00:00:00 2001 From: Chaitanya Bankanhal Date: Sat, 15 Aug 2020 23:33:07 +0530 Subject: [PATCH] rc: pass response writer when needsResponse is set instead of pointer rc: Fix failing tests for *http.ResponseWriter --- fs/rc/params.go | 2 +- fs/rc/rcserver/rcserver.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/rc/params.go b/fs/rc/params.go index e74e81b44..bdd020b1e 100644 --- a/fs/rc/params.go +++ b/fs/rc/params.go @@ -120,7 +120,7 @@ func (p Params) GetHTTPResponseWriter() (*http.ResponseWriter, error) { } request, ok := value.(*http.ResponseWriter) if !ok { - return nil, ErrParamInvalid{errors.Errorf("expecting http.ResponseWriter value for key %q (was %T)", key, value)} + return nil, ErrParamInvalid{errors.Errorf("expecting *http.ResponseWriter value for key %q (was %T)", key, value)} } return request, nil } diff --git a/fs/rc/rcserver/rcserver.go b/fs/rc/rcserver/rcserver.go index f6509baa6..e04cd0696 100644 --- a/fs/rc/rcserver/rcserver.go +++ b/fs/rc/rcserver/rcserver.go @@ -266,7 +266,7 @@ func (s *Server) handlePost(w http.ResponseWriter, r *http.Request, path string) } if call.NeedsResponse { - in["_response"] = &w + in["_response"] = w } // Check to see if it is async or not