# HG changeset patch # User amazy # Date 1505133178 -7200 # Node ID a2e3e7cd380e74e0ae75ecd85eda055c8e0a73ff # Parent 5125624e5cf35a0328b4c00dcedca4d179e5d7cd set content-type to application.json diff -r 5125624e5cf3 -r a2e3e7cd380e Plugin/AuthorizationWebService.cpp --- a/Plugin/AuthorizationWebService.cpp Wed Jul 19 09:17:56 2017 +0200 +++ b/Plugin/AuthorizationWebService.cpp Mon Sep 11 14:32:58 2017 +0200 @@ -76,19 +76,24 @@ uint16_t httpStatus = 0; uint32_t headersCount = 0; - const char* headersKeys[1]; - const char* headersValues[1]; + const char* headersKeys[2]; + const char* headersValues[2]; if (token != NULL && token->GetType() == TokenType_HttpHeader) { // If the token source is a HTTP header, forward it also as a // HTTP header - headersCount = 1; - headersKeys[0] = token->GetKey().c_str(); - headersValues[0] = tokenValue.c_str(); + headersKeys[headersCount] = token->GetKey().c_str(); + headersValues[headersCount] = tokenValue.c_str(); + headersCount++; } + // set the correct content type for the outgoing + headersKeys[headersCount] = "Content-Type"; + headersValues[headersCount] = "application/json"; + headersCount++; + std::string flatBody = body.toStyledString(); if (OrthancPluginHttpClient(context_, *answerBody, *answerHeaders,