mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +03:00
Moved request-id mw into parent app
- Moved request-id from shared to parent as it is not shared - This file is only used in one place, this updates the code structure to reflect this - This is one of many similar changes needed to make it easier to refactor to the existing setup
This commit is contained in:
parent
becc239de1
commit
8fe56852e0
@ -5,6 +5,7 @@ const config = require('../../config');
|
||||
const compress = require('compression');
|
||||
const netjet = require('netjet');
|
||||
const shared = require('../shared');
|
||||
const mw = require('./middleware');
|
||||
const escapeRegExp = require('lodash.escaperegexp');
|
||||
const {URL} = require('url');
|
||||
const sentry = require('../../sentry');
|
||||
@ -20,7 +21,7 @@ module.exports = function setupParentApp(options = {}) {
|
||||
// (X-Forwarded-Proto header will be checked, if present)
|
||||
parentApp.enable('trust proxy');
|
||||
|
||||
parentApp.use(shared.middlewares.requestId);
|
||||
parentApp.use(mw.requestId);
|
||||
parentApp.use(shared.middlewares.logRequest);
|
||||
|
||||
// Register event emmiter on req/res to trigger cache invalidation webhook event
|
||||
|
3
core/server/web/parent/middleware/index.js
Normal file
3
core/server/web/parent/middleware/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
requestId: require('./request-id')
|
||||
};
|
@ -51,10 +51,6 @@ module.exports = {
|
||||
return require('./pretty-urls');
|
||||
},
|
||||
|
||||
get requestId() {
|
||||
return require('./request-id');
|
||||
},
|
||||
|
||||
get uncapitalise() {
|
||||
return require('./uncapitalise');
|
||||
},
|
||||
|
@ -2,7 +2,7 @@ const should = require('should');
|
||||
const sinon = require('sinon');
|
||||
const validator = require('validator');
|
||||
|
||||
const requestId = require('../../../../core/server/web/shared/middlewares/request-id');
|
||||
const requestId = require('../../../../../core/server/web/parent/middleware/request-id');
|
||||
|
||||
describe('Request ID middleware', function () {
|
||||
var res, req, next;
|
Loading…
Reference in New Issue
Block a user