From c2a43b69a9dd0e718732c1ce94bc23f69ef7cde5 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 27 Aug 2015 18:49:52 -0700 Subject: [PATCH] Just pass the req.body through The metadata has things like restoreUrl and restoreKey which should not be passed through anyways --- src/server.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/server.js b/src/server.js index c09196724..3b4a33698 100755 --- a/src/server.js +++ b/src/server.js @@ -58,21 +58,11 @@ function update(req, res, next) { debug('provision: received from box %j', req.body); - superagent.get('http://169.254.169.254/metadata/v1.json').end(function (error, result) { - if (error || result.statusCode !== 200) { - console.error('Error getting metadata', error); - return; - } - - var userData = JSON.parse(result.body.user_data); - userData.sourceTarballUrl = req.body.sourceTarballUrl; - - installer.provision(userData, function (error) { - if (error) console.error(error); - }); - - next(new HttpSuccess(202, { })); + installer.provision(req.body, function (error) { + if (error) console.error(error); }); + + next(new HttpSuccess(202, { })); } function retire(req, res, next) {