Update build.func

This commit is contained in:
Michel Roegl-Brunner 2025-01-28 10:40:43 +01:00
parent c04ec818fe
commit 08286bc999

View File

@ -837,13 +837,15 @@ post_to_api() {
EOF EOF
) )
RESPONSE=$(curl -s -o response.txt -w "%{http_code}" -X POST "$API_URL" \ RESPONSE=$(curl -s -o response.txt -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "$JSON_PAYLOAD") -d "$JSON_PAYLOAD")
if [ ! "$RESPONSE" -eq 201 ]; then if [ "$RESPONSE" -ne 201 ] && [ "$RESPONSE" -ne 302 ]; then
msg_error "API request failed with HTTP code $RESPONSE" msg_error "API request failed with HTTP code $RESPONSE"
fi fi
} }
install_script() { install_script() {