0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core
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
..
client@eb4ff95383 Updated Ghost-Admin to 2.30.2 2019-08-28 11:39:00 +01:00
frontend Added guard to asset helper for missing paths 2019-09-09 13:02:45 +01:00
server 🐛 Fixed "View site" screen in admin on private sites with separate admin url (#11098) 2019-09-09 17:42:55 +01:00
test Fixed regression tests expecting relative URLs for admin redirects 2019-09-09 15:52:26 +01:00
index.js Changed where we trigger server start/stop announcement (#9815) 2018-08-22 13:28:31 +02:00