From deaf6918e98257ab412a145a563c336cc975f14f Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Tue, 28 Jan 2025 10:42:04 +0100 Subject: [PATCH] Update build.func --- misc/build.func | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/build.func b/misc/build.func index 586c75ba..57918a22 100644 --- a/misc/build.func +++ b/misc/build.func @@ -837,11 +837,11 @@ post_to_api() { 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" \ -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" fi }