couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [53/53] [abbrv] fauxton commit: updated refs/heads/master to 8699e98
Date Wed, 23 Mar 2016 12:24:55 GMT
server polishing for webpack


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/8699e98a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/8699e98a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/8699e98a

Branch: refs/heads/master
Commit: 8699e98ab207f6c2687fe5eb85abec03eb3b2de5
Parents: 94497ca
Author: Garren Smith <garren.smith@gmail.com>
Authored: Wed Mar 23 12:50:51 2016 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Wed Mar 23 12:50:51 2016 +0200

----------------------------------------------------------------------
 .travis.yml  | 2 +-
 devserver.js | 8 ++++++--
 index.js     | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8699e98a/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 2c593e6..e971b59 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,7 +31,7 @@ before_install:
 before_script:
   - npm test
   - grunt debugDev
-  - DIST=./dist/debug/ ./bin/fauxton &
+  - ./bin/fauxton &
   - sleep 30
 script:
   - ./node_modules/grunt-cli/bin/grunt nightwatch

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8699e98a/devserver.js
----------------------------------------------------------------------
diff --git a/devserver.js b/devserver.js
index f9c975a..ba540b2 100644
--- a/devserver.js
+++ b/devserver.js
@@ -67,14 +67,17 @@ var devSetup = function (cb) {
   });
 };
 
-var headerValue = "default-src 'self'; child-src 'self' data: blob:; img-src 'self' data:;
font-src 'self'; " +
+var defaultHeaderValue = "default-src 'self'; child-src 'self' data: blob:; img-src 'self'
data:; font-src 'self'; " +
                   "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';";
 var setCSP = function (res) {
   if (!settings.contentSecurityPolicy) {
     return;
   }
 
-  //res.setHeader('Content-Security-Policy', settings.contentSecurityPolicyHeader);
+  var headerValue = settings.contentSecurityPolicyHeader || defaultHeaderValue;
+
+  console.log('seeting', headerValue);
+  res.set('Content-Security-Policy', headerValue);
 };
 
 var runWebpackServer = function () {
@@ -120,6 +123,7 @@ var runWebpackServer = function () {
   });
 
   server.app.all('*', function (req, res, next) {
+    setCSP(res);
     proxy.web(req, res);
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/8699e98a/index.js
----------------------------------------------------------------------
diff --git a/index.js b/index.js
index 43fd3fe..204eba3 100644
--- a/index.js
+++ b/index.js
@@ -4,7 +4,7 @@ var httpProxy = require('http-proxy');
 var send = require('send');
 var urlLib = require('url');
 var _ = require('lodash');
-var dist_dir = process.env.DIST || __dirname + '/dist/release/';
+var dist_dir = process.env.DIST || __dirname + '/dist/debug/';
 
 module.exports = function (options) {
   // Options


Mime
View raw message