зеркало из https://github.com/mozilla/hubs.git
Make WDS CORS settings correct
This commit is contained in:
Родитель
2703b6d7d0
Коммит
c98d15a920
|
@ -3206,6 +3206,16 @@
|
|||
"resolved": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
|
||||
},
|
||||
"cors": {
|
||||
"version": "2.8.4",
|
||||
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz",
|
||||
"integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"object-assign": "^4",
|
||||
"vary": "^1"
|
||||
}
|
||||
},
|
||||
"cosmiconfig": {
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.5.tgz",
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"copy-webpack-plugin": "^4.5.1",
|
||||
"cors": "^2.8.4",
|
||||
"css-loader": "^1.0.0",
|
||||
"dotenv": "^5.0.1",
|
||||
"eslint": "^5.2.0",
|
||||
|
|
|
@ -7,6 +7,7 @@ const fs = require("fs");
|
|||
const path = require("path");
|
||||
const selfsigned = require("selfsigned");
|
||||
const webpack = require("webpack");
|
||||
const cors = require("cors");
|
||||
const HTMLWebpackPlugin = require("html-webpack-plugin");
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
|
@ -76,8 +77,9 @@ module.exports = (env, argv) => ({
|
|||
host: "0.0.0.0",
|
||||
useLocalIp: true,
|
||||
allowedHosts: ["hubs.local"],
|
||||
headers: { "Access-Control-Allow-Origin": "hubs.local" },
|
||||
before: function(app) {
|
||||
// be flexible with people accessing via a local reticulum on another port
|
||||
app.use(cors({ origin: /hubs\.local(:\d*)?$/ }));
|
||||
// networked-aframe makes HEAD requests to the server for time syncing. Respond with an empty body.
|
||||
app.head("*", function(req, res, next) {
|
||||
if (req.method === "HEAD") {
|
||||
|
|
Загрузка…
Ссылка в новой задаче