You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dr...@apache.org on 2014/02/03 18:40:02 UTC
git commit: added whitelist hack
Updated Branches:
refs/heads/master c7077a59e -> e39ab0154
added whitelist hack
Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/e39ab015
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/e39ab015
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/e39ab015
Branch: refs/heads/master
Commit: e39ab0154230f3a22ab6c7766b65897d4be84fa8
Parents: c7077a5
Author: David Kemp <dr...@chromium.org>
Authored: Mon Feb 3 12:39:21 2014 -0500
Committer: David Kemp <dr...@chromium.org>
Committed: Mon Feb 3 12:39:21 2014 -0500
----------------------------------------------------------------------
runner/testrunner.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/e39ab015/runner/testrunner.js
----------------------------------------------------------------------
diff --git a/runner/testrunner.js b/runner/testrunner.js
index 70a4c01..faf1f69 100644
--- a/runner/testrunner.js
+++ b/runner/testrunner.js
@@ -30,6 +30,21 @@ function writejson(port,cfgpath){
fs.writeFileSync(path.join(cfgpath,'medic.json'), JSON.stringify(cfgobj));
}
+function writeWhitelist(ip){
+ if(! (ip=='127.0.0.1')){
+ try {
+ var url='http://'+ip+'/*';
+ var manifest = path.join(testpath,'manifest.json');
+ fs.writeFileSync(manifest, fs.readFileSync(manifest, 'utf-8').replace(/http:\/\/127\.0\.0\.1\/\*/gi, url), 'utf-8');
+ console.log('Completed Whitelist update for: ',ip);
+ } catch (err) {
+ console.log('Failed to update whitelist: ',err);
+ }
+ } else {
+ console.log('Skipping Whitelist update for: ',ip);
+ }
+}
+
function startTest(){
console.log("starting test "+cmdpath);
if(cmdargs){
@@ -86,6 +101,7 @@ var server = http.createServer(function (req, res) {
server.listen(logport,logip,511,function(){
logport = server.address().port;
console.log('Server running at '+logurl+':'+logport);
+ writeWhitelist(logip);
writejson(logport,testpath);
startTest();
});