Commit Graph

5 Commits

Author SHA1 Message Date
Naz
e2c7c21e86 Added typings to the middleware to imporve checks
refs https://github.com/TryGhost/Toolbox/issues/292

- Having types would potentially have prevented a bug from a parent commit with mistyped property name
2022-05-09 15:35:09 +08:00
Naz
7419ff2c4f Fixed requestURL value passed to the APIVersionCompatibilityService
refs https://github.com/TryGhost/Toolbox/issues/292

- There was a typo in the variable name - req.originalURL is NOT does not exist on express' reqest object
- Added tests to avoid similar mistake again
2022-05-09 15:35:09 +08:00
Naz
fc7e1c383e Added requestURL handling in version mismatch middleware
refs https://github.com/TryGhost/Toolbox/issues/292

- We need to pass this data so that emails include this bit of information
2022-05-05 17:56:18 +08:00
Naz
4873303658 Added handling for version missmatch as a midleware
refs https://github.com/TryGhost/Toolbox/issues/292

- This middleware is meant to deal with version missmatch erros and call a service that does all the business logic. Having this handling in a separate module allows for thisngs to be loosely coupled
2022-04-21 15:57:43 +08:00
Naz
786f5429db Bootstrapped api version mismatch middleware
refs https://github.com/TryGhost/Toolbox/issues/292

- Fresh package out of Super Slimer and removed outdated patters, like using "should"
2022-04-21 15:57:43 +08:00