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:
Claude 2026-03-19 11:28:00 +00:00
parent 2df3c579e4
commit d7eb5ef6fe
No known key found for this signature in database

View file

@ -155,7 +155,7 @@ print(json.dumps(routes))
--write-out "\nHTTP_STATUS:%{http_code}" \
"${CADDY_API}/config/apps/http/servers/hiy/routes" \
--header "Content-Type: application/json" \
--request PUT \
--request PATCH \
--data "$UPDATED" 2>&1)
set -e
if echo "$CADDY_RESP" | grep -q "HTTP_STATUS:2"; then