From 8688c2878a20af1e4a0b2ac3692f17be98d755c6 Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Mon, 14 Nov 2016 15:43:24 +0200 Subject: [PATCH] Set correct content-type for o-r-c curl calls They contained json data, so they need application/json as the content types. Else, some wsgi implementations will interpret the contents in an undesired way, such as apache's mod_wsgi setting the whole POST body as a POST parameter with no value. Change-Id: Id988e8d286761550da4849c0695f5f5a37116a11 Closes-Bug: #1641589 --- .../os-refresh-config/post-configure.d/99-refresh-completed | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elements/os-refresh-config/os-refresh-config/post-configure.d/99-refresh-completed b/elements/os-refresh-config/os-refresh-config/post-configure.d/99-refresh-completed index 21c35a785..507b25040 100755 --- a/elements/os-refresh-config/os-refresh-config/post-configure.d/99-refresh-completed +++ b/elements/os-refresh-config/os-refresh-config/post-configure.d/99-refresh-completed @@ -16,7 +16,7 @@ call_curl() { local method=$1 local url=$2 local output=$(mktemp) - status=$(curl -s -w %{http_code} -X $method -H 'Content-Type:' -o $output --data-binary "{\"Status\" : \"SUCCESS\",\"Reason\" : \"Configuration Complete\",\"UniqueId\" : \"$ID\",\"Data\" : \"Finished os-refresh-config.\"}" $url) + status=$(curl -s -w %{http_code} -X $method -H 'Content-Type: application/json' -o $output --data-binary "{\"Status\" : \"SUCCESS\",\"Reason\" : \"Configuration Complete\",\"UniqueId\" : \"$ID\",\"Data\" : \"Finished os-refresh-config.\"}" $url) cat $output rm $output if [ "$status" != "200" ]; then @@ -29,7 +29,7 @@ call_curl_deployment() { local url=$2 local stdout=$3 local output=$(mktemp) - status=$(curl -s -w %{http_code} -X $method -H 'Content-Type:' -o $output --data-binary "{\"deploy_stdout\": \"$stdout\", \"deploy_status_code\": \"0\"}" $url) + status=$(curl -s -w %{http_code} -X $method -H 'Content-Type: application/json' -o $output --data-binary "{\"deploy_stdout\": \"$stdout\", \"deploy_status_code\": \"0\"}" $url) cat $output rm $output if [ "$status" != "200" ]; then