diff --git a/processing/speechtotext/speechtotext.js b/processing/speechtotext/speechtotext.js index 8f7b490f..0b110ed7 100644 --- a/processing/speechtotext/speechtotext.js +++ b/processing/speechtotext/speechtotext.js @@ -66,17 +66,18 @@ function onChallengeRequest(challenge, secret, signature) { console.log('[OK] Challenge accepted!'); return { headers: { - // force Content-Type as JSON as Watson sends an Accept: application/json - 'Content-Type': 'application/json' + 'Content-Type': 'text/plain' }, - // but sends the body as raw data as Watson expects plain text - body: new Buffer(challenge).toString('base64') + body: challenge }; } console.log('[KO] Signature does not match'); return { code: 500, + headers: { + 'Content-Type': 'text/plain' + }, body: 'Bad signature' }; }