fix: use PATCH not PUT to update Caddy routes
Caddy admin API: PUT creates a key (409 if exists), PATCH replaces it. Since routes always exists after startup from caddy.json, PATCH is correct.
This commit is contained in:
parent
2df3c579e4
commit
d7eb5ef6fe
1 changed files with 1 additions and 1 deletions
|
|
@ -155,7 +155,7 @@ print(json.dumps(routes))
|
||||||
--write-out "\nHTTP_STATUS:%{http_code}" \
|
--write-out "\nHTTP_STATUS:%{http_code}" \
|
||||||
"${CADDY_API}/config/apps/http/servers/hiy/routes" \
|
"${CADDY_API}/config/apps/http/servers/hiy/routes" \
|
||||||
--header "Content-Type: application/json" \
|
--header "Content-Type: application/json" \
|
||||||
--request PUT \
|
--request PATCH \
|
||||||
--data "$UPDATED" 2>&1)
|
--data "$UPDATED" 2>&1)
|
||||||
set -e
|
set -e
|
||||||
if echo "$CADDY_RESP" | grep -q "HTTP_STATUS:2"; then
|
if echo "$CADDY_RESP" | grep -q "HTTP_STATUS:2"; then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue