Skip to content

Commit ae3a1e9

Browse files
committed
Updated middleware tosend Accept and Contenttype headers to underlying webhook
1 parent 3f3609c commit ae3a1e9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

server/routes/middleware.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ function updateAndSendRasaResponse(req,cacheKey,rasa_response, modelName, projec
269269
request.post({
270270
url: data[0].endpoint_url,
271271
headers : {
272-
"Authorization" : "Bearer "+req.original_token
273-
},
274-
form: rasa_response
272+
"Accept": "application/json",
273+
"Content-Type": "application/json",
274+
"Authorization" : "Bearer "+req.original_token
275+
},
276+
body: JSON.stringify(rasa_response)
275277
},
276278
function (error, response, body){
277279
if(error){

web/src/app/components/training/training.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<div class="col-sm-3">
2626
<button type="button" class="btn btn-success" ng-show="exportdata !== undefined" ng-click="train()"><i class="fa fa-magic"></i>&nbsp; Start Training</button>
2727
<button type="button" class="btn btn-secondary" ng-show="exportdata !== undefined" ng-click="savetofile()"><i class="fa fa-file"></i>&nbsp; Download File</button>
28+
<a href="" id="a"></a>
2829
</div>
2930
<div class="col-sm-3">
3031
<span ng-show="exportdata !== undefined" >To Lower case <label class="switch switch-3d switch-success" ng-show="exportdata !== undefined">

0 commit comments

Comments
 (0)