Allow outgoing scripts to call HTTP

pull/2481/head
Rodrigo Nascimento 10 years ago
parent 07e7bf21bf
commit e952dfd3b5
  1. 8
      packages/rocketchat-integrations/server/triggers.coffee

@ -22,6 +22,14 @@ executeScript = (scriptContent, name, sandbox) ->
sandbox._ = _
sandbox.s = s
sandbox.console = console
sandbox.HTTP = (method, url, options) ->
try
return {} =
result: HTTP.call method, url, options
catch e
return {} =
error: e
vmScript.runInNewContext sandbox
logger.outgoing.debug 'result', sandbox.result

Loading…
Cancel
Save