🐛 Fixed CORS for errors from Content API
closes #10932 Previously we were only applying the cors middleware to the options preflight request, which meant that if the request errored, the cors headers would not be applied, resulting in the client being unable to read response data. This applies the cors middleware to _all_ requests to the Content API.
This commit is contained in:
parent
5da8da1879
commit
2cb41dd8cd
@ -1,3 +1,7 @@
|
||||
{
|
||||
"enableDeveloperExperiments": true
|
||||
"enableDeveloperExperiments": true,
|
||||
"url": "http://site.egg",
|
||||
"admin": {
|
||||
"url": "http://site.ghost.egg"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ const mw = require('./middleware');
|
||||
module.exports = function apiRoutes() {
|
||||
const router = express.Router();
|
||||
|
||||
router.options('*', cors());
|
||||
router.use(cors());
|
||||
|
||||
const http = apiv2.http;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user