mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
4b51942403
fix https://linear.app/ghost/issue/ENG-1502/handle-malformed-client-versions-to-avoid-versionmismatcherror - in the event we pass a client version that is invalid (ie, anything that doesn't resemble semver version), we currently throw a VersionMismatchError - this is slightly misleading because although it is a version mismatch, it moreso that it's an invalid string to pass in this header - to fix that, we can just use `validRange` from `semver` to detect this, and throw a BadRequestError with a meaningful error message - this helps us detect whether the header is actually a version mismatch, or an invalid input |
||
---|---|---|
.. | ||
lib | ||
test | ||
.eslintrc.js | ||
index.js | ||
package.json | ||
README.md |
Mw Version Match
Version compatibility middleware for Ghost
Usage
Develop
This is a monorepo package.
Follow the instructions for the top-level repo.
git clone
this repo &cd
into it as usual- Run
yarn
to install top-level dependencies.
Test
yarn lint
run just eslintyarn test
run lint and tests