BVB Source Codes

prerender Show whitelist.js Source code

Return Download prerender: download whitelist.js Source code - Download prerender Source code - Type:.js
  1. var url = require("url");
  2.  
  3. module.exports = {
  4.         init: function() {
  5.                 this.ALLOWED_DOMAINS = (process.env.ALLOWED_DOMAINS && process.env.ALLOWED_DOMAINS.split(',')) || [];
  6.         },
  7.     beforePhantomRequest: function(req, res, next) {
  8.         var parsed = url.parse(req.prerender.url);
  9.  
  10.         if(this.ALLOWED_DOMAINS.indexOf(parsed.hostname) > -1) {
  11.             next();
  12.         } else {
  13.             res.send(404);
  14.         }
  15.     }
  16. }
downloadwhitelist.js Source code - Download prerender Source code
Related Source Codes/Software:
libsodium - A modern and easy-to-use crypto library. 2017-01-09
Side-Menu.Android - Side menu with some categories to choose. ... 2017-01-09
docker-gitlab - Dockerized GitLab http://www.da... 2017-01-09
sinon - Test spies, stubs and mocks for JavaScript. ... 2017-01-09
in-view - Get notified when a DOM element enters or exits th... 2017-01-09
falcon - Falcon is a low-level, high-performance Python fra... 2017-01-09
ImageOptim - GUI image optimizer for Mac htt... 2017-01-09
node-style-guide - A guide for styling your node.js / JavaScript code... 2017-01-09
FDFullscreenPopGesture - A UINavigationController's category to enable full... 2017-01-10
Gource - oftware version control visualization ... 2017-01-10
CLNDR - 2017-02-19
OptiKey - OptiKey - Full computer control and speech with yo... 2017-02-19
MRProgress - Collection of iOS drop-in components to visualize ... 2017-02-19
BGARefreshLayout-Android - On a variety of drop-down refresh effect, loading ... 2017-02-19
angular-http-auth - 2017-02-19
pydata-book - Materials and IPython notebooks for "Python for Da... 2017-02-19
xenia - Xbox 360 Emulator Research Project ... 2017-02-18
flux-comparison - 2017-02-18
luvit - Lua + libUV + jIT = pure awesomesauce ... 2017-02-18
orleans - Orleans - Distributed Virtual Actor Model ... 2017-02-18

 Back to top