0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

🐛 Fixed 500 error when visiting an email-only post link

refs 74280cfbea

- We allow to send email-only posts when using v4 Admin API, but it's possible to configure a v3 Theme with a site instance which resulta in an unsupported behavior throwing a 500.
- With this fix a 404 will be returned when an email-only post is viewed through the public email-only post URL
This commit is contained in:
Naz 2021-10-26 16:01:10 +04:00 committed by Daniel Lockyer
parent 5d9e237951
commit f6c81033d7
No known key found for this signature in database
GPG key ID: D21186F0B47295AD

View file

@ -108,9 +108,11 @@ class RouterManager {
this.siteRouter.mountRouter(unsubscribeRouter.router());
this.registry.setRouter('unsubscribeRouter', unsubscribeRouter);
const emailRouter = new EmailRouter(RESOURCE_CONFIG);
this.siteRouter.mountRouter(emailRouter.router());
this.registry.setRouter('emailRouter', emailRouter);
if (RESOURCE_CONFIG.QUERY.email) {
const emailRouter = new EmailRouter(RESOURCE_CONFIG);
this.siteRouter.mountRouter(emailRouter.router());
this.registry.setRouter('emailRouter', emailRouter);
}
const previewRouter = new PreviewRouter(RESOURCE_CONFIG);
this.siteRouter.mountRouter(previewRouter.router());