aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/createOriginMiddleware.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/createOriginMiddleware.js')
-rw-r--r--app/scripts/lib/createOriginMiddleware.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/scripts/lib/createOriginMiddleware.js b/app/scripts/lib/createOriginMiddleware.js
new file mode 100644
index 000000000..f8bdb2dc2
--- /dev/null
+++ b/app/scripts/lib/createOriginMiddleware.js
@@ -0,0 +1,9 @@
+// append dapp origin domain to request
+module.exports = createOriginMiddleware
+
+function createOriginMiddleware ({ origin }) {
+ return function originMiddleware (req, res, next, end) {
+ req.origin = origin
+ next()
+ }
+}