rc: fix unmarshalable http.AuthFn in options and put in test for marshalability

This commit is contained in:
Nick Craig-Wood 2019-08-10 16:22:17 +01:00
parent 99eaa76dc8
commit 0693deea1c
3 changed files with 37 additions and 8 deletions

View file

@ -229,7 +229,8 @@ func (s *Server) handlePost(w http.ResponseWriter, r *http.Request, path string)
fs.Debugf(nil, "rc: %q: reply %+v: %v", path, out, err)
err = rc.WriteJSON(w, out)
if err != nil {
// can't return the error at this point
// can't return the error at this point - but have a go anyway
writeError(path, in, w, err, http.StatusInternalServerError)
fs.Errorf(nil, "rc: failed to write JSON output: %v", err)
}
}