Commit 305886fa authored by Krit Punpreuk's avatar Krit Punpreuk

Update perform.js

parent 9cd012b9
...@@ -10,19 +10,22 @@ function execute_function(context,output,response){ ...@@ -10,19 +10,22 @@ function execute_function(context,output,response){
var output_type = 'text'; var output_type = 'text';
var url = param.url; var url = param.url;
var body = param.body;
var env = { var env = {
'output' : { 'output' : {
'meta' : meta, 'meta' : meta,
'data' : data 'data' : data
}, },
'url' : '' 'url' : '',
'body':''
} }
var script = new vm.Script("url=`" + url + "`"); var script = new vm.Script("url=`" + url + "`;body=`" + body + "`");
var context = new vm.createContext(env); var context = new vm.createContext(env);
script.runInContext(context); script.runInContext(context);
url = env.url; url = env.url;
body = env.body;
var reject = true; var reject = true;
...@@ -51,7 +54,7 @@ function execute_function(context,output,response){ ...@@ -51,7 +54,7 @@ function execute_function(context,output,response){
// Setup Body if POST or PUT // Setup Body if POST or PUT
if(method == 'POST' || method == 'PUT') { if(method == 'POST' || method == 'PUT') {
if(typeof param.body == 'object') { if(typeof param.body == 'object') {
option.body = param.body option.body = body
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment