From 02e88beda5415e51b42e33527af90cf59d6a759e Mon Sep 17 00:00:00 2001 From: Aeneas Date: Sat, 21 Oct 2017 14:32:43 +0200 Subject: [PATCH] Return arrays instead of null on rule creation (#6) --- rule/handler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rule/handler.go b/rule/handler.go index 30084af245..ff1410036b 100644 --- a/rule/handler.go +++ b/rule/handler.go @@ -186,7 +186,10 @@ func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.P } func decodeRule(w http.ResponseWriter, r *http.Request) (*Rule, error) { - var rule jsonRule + rule := jsonRule{ + MatchesMethods: []string{}, + RequiredScopes: []string{}, + } if err := json.NewDecoder(r.Body).Decode(&rule); err != nil { return nil, err }