Skip to content

Commit

Permalink
Provided fallback value for hostname in local environments when proce…
Browse files Browse the repository at this point in the history
…ssing CORS requests from non-browser environments.
  • Loading branch information
coreybutler committed Jun 11, 2020
1 parent eb11dcb commit e51b995
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class Endpoint {
// Common use case: Running a web server and API
// server on separate ports during dev, but under
// the same context (i.e. mimicking a production domain)
host = req.get('origin') || req.get('referer')
host = req.get('origin') || req.get('referer') || host
host = host.indexOf('localhost') >= 0 ? host : '*'
} catch (e) {
console.log(e)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@butlerlogic/common-api",
"version": "1.3.9",
"version": "1.3.10",
"description": "An API engineering productivity kit for Express.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e51b995

Please sign in to comment.