Skip to content

Commit

Permalink
馃悰 Fixed site changed webhook not triggered for scheduled posts
Browse files Browse the repository at this point in the history
closes #10226

- Middleware emits site-changed event used to trigger webhook, was configured to v2 admin api only.
- Change allows all versions of api to emit event in case of cache invalidation
  • Loading branch information
rishabhgrg authored and allouis committed Dec 4, 2018
1 parent 8b816af commit 033ddf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions core/server/web/api/v2/admin/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ module.exports = function setupApiApp() {
// API shouldn't be cached
apiApp.use(shared.middlewares.cacheControl('private'));

// Register event emmiter on req/res to trigger cache invalidation webhook event
apiApp.use(shared.middlewares.emitEvents);

// Routing
apiApp.use(routes());

Expand Down
3 changes: 3 additions & 0 deletions core/server/web/parent-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module.exports = function setupParentApp(options = {}) {

parentApp.use(shared.middlewares.logRequest);

// Register event emmiter on req/res to trigger cache invalidation webhook event
parentApp.use(shared.middlewares.emitEvents);

// enabled gzip compression by default
if (config.get('compress') !== false) {
parentApp.use(compress());
Expand Down

0 comments on commit 033ddf1

Please sign in to comment.