From 9b1a4d7376ac69465195245ec463be9516cb5d9c Mon Sep 17 00:00:00 2001 From: skublik Date: Mon, 1 Oct 2018 19:54:06 +0000 Subject: [PATCH] adding condition for response 202 --- library.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.bash b/library.bash index 50c9cc6..0b2172f 100644 --- a/library.bash +++ b/library.bash @@ -137,7 +137,7 @@ function add_object () { response=$(curl -k -sD - --silent --write-out "%{http_code}" --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST "https://localhost:8443/midpoint/ws/rest/$TYPE" -d @$FILE) http_code=$(sed '$!d' <<<"$response") - if [ "$http_code" -eq 201 ]; then + if [ "$http_code" -eq 201 ] || [ "$http_code" -eq 202 ]; then headers=$(sed -n '1,/^\r$/p' <<<"$response") # get the real Location