Added cleanup note
refs https://github.com/TryGhost/Toolbox/issues/516
refs 4c60cdce9c
- The syntax used to skip non-`/r/` routes is unreadable. Needs a little love during cleanup
This commit is contained in:
parent
0f08f39a1b
commit
b35b1ae98b
@ -87,6 +87,12 @@ class LinkRedirectsService {
|
||||
async handleRequest(req, res, next) {
|
||||
// skip handling if original url doesn't match the prefix
|
||||
const fullURLWithRedirectPrefix = `${this.#baseURL.pathname}${this.#redirectURLPrefix}`;
|
||||
// @NOTE: below is equivalent to doing:
|
||||
// router.get('/r/'), (req, res) ...
|
||||
// To make it cleaner we should rework it to:
|
||||
// linkRedirects.service.handleRequest(router);
|
||||
// and mount routes on top like for example sitemapHandler does
|
||||
// Cleanup issue: https://github.com/TryGhost/Toolbox/issues/516
|
||||
if (!req.originalUrl.startsWith(fullURLWithRedirectPrefix)) {
|
||||
return next();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user