summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-30 16:28:22 -0700
committer8cy <[email protected]>2020-04-30 16:28:22 -0700
commit60e17ae0b6d7caa6ef1bd4dfdeaf26d055b06701 (patch)
tree9c5abfd06eb584aea8816369a293c6e5c83595b9
parentallow cors, v1.1.0 (diff)
downloaduppity-60e17ae0b6d7caa6ef1bd4dfdeaf26d055b06701.tar.xz
uppity-60e17ae0b6d7caa6ef1bd4dfdeaf26d055b06701.zip
cors, v1.1.1
-rw-r--r--package.json2
-rw-r--r--ws/ws.js7
2 files changed, 7 insertions, 2 deletions
diff --git a/package.json b/package.json
index 5932024..6cad5d4 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "uppity",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "This bot's sole purpose is to check the uptime of uwufier.",
"main": "./bot.js",
"scripts": {
diff --git a/ws/ws.js b/ws/ws.js
index 3cbbde1..f3bb436 100644
--- a/ws/ws.js
+++ b/ws/ws.js
@@ -9,7 +9,6 @@ class WebSocket {
this.client = client;
this.app = express();
- this.app.use(allowCrossDomain);
this.app.engine('hbs', hbs({
extname: 'hbs',
defaultLayout: 'layout',
@@ -45,6 +44,12 @@ class WebSocket {
// http://localhost:port?token=123456
registerRoots() {
+ this.app.all('*', function (req, res, next) {
+ res.header('Access-Control-Allow-Origin', '*');
+ res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
+ res.header('Access-Control-Allow-Headers', 'Content-Type');
+ next();
+ });
this.app.get('/', (req, res) => {
var _token = req.query.token;
if (this.checkToken(_token)) {