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:
parent
5d9e237951
commit
f6c81033d7
1 changed files with 5 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue