Skip to content

Commit

Permalink
ignore port for cors origin check
Browse files Browse the repository at this point in the history
makes it possible to test app on localhost
  • Loading branch information
gka committed Oct 14, 2017
1 parent 3309e4d commit 3fe07d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function isAdmin(user) {

function checkOrigin(origin, callback) {
// origin is allowed
if (typeof origin === 'undefined' || `.${url.parse(origin).host}`.endsWith(`.${schnack_domain}`)) {
if (typeof origin === 'undefined' || `.${url.parse(origin).hostname}`.endsWith(`.${schnack_domain}`)) {
return callback(null, true);
}

Expand Down

0 comments on commit 3fe07d8

Please sign in to comment.