mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 15:53:17 +00:00
admin: POST /... expands and appends all array elements
Makes it easy to append many items to an array in one command
This commit is contained in:
parent
5ab17a3a37
commit
6455efa5d3
2 changed files with 39 additions and 6 deletions
|
@ -77,6 +77,12 @@ func TestUnsyncedConfigAccess(t *testing.T) {
|
|||
payload: `"d"`,
|
||||
expect: `{"foo": "jet", "bar": {"aa": "bb"}, "list": ["a", "b", "c", "d"]}`,
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/list/...",
|
||||
payload: `["e", "f", "g"]`,
|
||||
expect: `{"foo": "jet", "bar": {"aa": "bb"}, "list": ["a", "b", "c", "d", "e", "f", "g"]}`,
|
||||
},
|
||||
} {
|
||||
err := unsyncedConfigAccess(tc.method, rawConfigKey+tc.path, []byte(tc.payload), nil)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue