From c3bcd967bd3be85c41ac5f630d496f0dc0d18115 Mon Sep 17 00:00:00 2001 From: Abdelmalek Ihdene <52615297+AbdelmalekIhdene@users.noreply.github.com> Date: Sun, 15 Dec 2019 14:58:01 -0500 Subject: logging: Implement net writer (#2884) * Implement UDP writer * Implement Net Writer * Utilize Caddy's address parsing functions * A couple little fixes (see #2884) --- admin.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'admin.go') diff --git a/admin.go b/admin.go index 570d94c..d6f1787 100644 --- a/admin.go +++ b/admin.go @@ -711,6 +711,12 @@ traverseLoop: return fmt.Errorf("unrecognized method %s", method) } } else { + // if we are "PUTting" a new resource, the key(s) in its path + // might not exist yet; that's OK but we need to make them as + // we go, while we still have a pointer from the level above + if v[part] == nil && method == http.MethodPut { + v[part] = make(map[string]interface{}) + } ptr = v[part] } -- cgit v1.2.3