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
(cherry picked from commit 8688c2878a
)
This commit is contained in:
parent
7455be0697
commit
3ecf477958
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue