summaryrefslogtreecommitdiff
path: root/admin.go
diff options
context:
space:
mode:
authorAbdelmalek Ihdene <52615297+AbdelmalekIhdene@users.noreply.github.com>2019-12-15 14:58:01 -0500
committerMatt Holt <mholt@users.noreply.github.com>2019-12-15 12:58:01 -0700
commitc3bcd967bd3be85c41ac5f630d496f0dc0d18115 (patch)
tree8bb555badd890eb1713dcc20d99ab81a3e98367f /admin.go
parent6ea121ddf8c5be6de892971782d6f0fe2938ebbf (diff)
logging: Implement net writer (#2884)
* Implement UDP writer * Implement Net Writer * Utilize Caddy's address parsing functions * A couple little fixes (see #2884)
Diffstat (limited to 'admin.go')
-rw-r--r--admin.go6
1 files changed, 6 insertions, 0 deletions
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]
}