mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03: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:
parent
e851e28b16
commit
6e6f427149
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user