Ghost/core/server
Kevin Ansfield ba3c26ef5c
🐛 Fixed "View site" screen in admin on private sites with separate admin url (#11098)
closes https://github.com/TryGhost/Ghost/issues/11078

Problem:
- the admin client makes an XHR request to the `/private/` endpoint when a private site is configured
- when a separate admin URL is configured this was causing 500 errors in the admin client because missing CORS headers on the endpoint was causing browsers to abort the request
- browsers will also look at the CORS headers on any resources that are the result of a redirect and abort the request if they do not allow cross-origin requests, this means allowing all requests on `/private/` is not enough

Solution:
- uses the `cors` middleware with a dynamic options function for the whole of the front-end site app
- dynamic options function allows the following requests through:
  - same-origin (browsers and non-browser agents will not send an `Origin` header)
  - origin is `localhost` or `127.0.0.1` with any protocol and port
  - origin matches the configured `url` hostname+port on any protocol
  - origin matches the configured `admin:url` hostname+port on any protocol
2019-09-09 17:42:55 +01:00
..
adapters Return correct error codes from storage adapter 2019-09-06 17:40:55 +01:00
api Updated getMember to return null rather than throw 2019-09-05 11:14:50 +08:00
config 💡 Added canary api endpoint 2019-08-09 20:46:49 +05:30
data Removed name and password columns from members table 2019-09-05 11:14:50 +08:00
lib Added support for bookmark card (#11024) 2019-08-27 15:01:02 +01:00
models Revert "Removed defaultColumnsToFetch from models (#11010)" (#11045) 2019-08-21 23:56:35 +05:30
public Updated members.js & members.min.js (#11082) 2019-09-06 16:07:46 +08:00
services Cached member data in ghost-members-ssr-cache cookie (#11096) 2019-09-09 17:39:46 +08:00
translations Added guard to asset helper for missing paths 2019-09-09 13:02:45 +01:00
views Update default 404 page 2019-07-15 14:47:01 +02:00
web 🐛 Fixed "View site" screen in admin on private sites with separate admin url (#11098) 2019-09-09 17:42:55 +01:00
analytics-events.js Added event to integrations when created (#10588) 2019-03-11 15:28:17 +01:00
ghost-server.js Update Test & linting packages (major) (#10858) 2019-07-05 13:40:43 +02:00
index.js Extracted settings service part manipulating routes.yaml (#10800) 2019-06-25 18:33:56 +02:00
overrides.js Disabled bluebird debug logs 2018-08-13 14:01:31 +02:00
update-check.js Updated links to docs (#10941) 2019-07-22 18:17:50 +08:00