From a33e34f9423790fb0fd74af6f214b88f2f3883ba Mon Sep 17 00:00:00 2001 From: Yasser Hussain Date: Thu, 27 Oct 2016 18:41:20 +0530 Subject: [PATCH] Code with hyperdev.com url should not run --- client/rechallenge/throwers.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/rechallenge/throwers.js b/client/rechallenge/throwers.js index ad25cf54a6..13d804f00b 100644 --- a/client/rechallenge/throwers.js +++ b/client/rechallenge/throwers.js @@ -48,6 +48,16 @@ const throwForJsHtml = { throw new Error('Invalid if (null) console.log(1); detected'); } } + }, { + name: 'hyperdev in code', + description: 'Code with the URL hyperdev.com ' + + 'should not be allowed to run', + detectHyperdevInCode: /hyperdev\.com/gi, + thrower: function checkForHyperdev({ contents }) { + if (contents.match(this.detectHyperdevInCode)) { + throw new Error('Hyperdev.com should not be in the code'); + } + } } ] };