0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/web/api
Hannah Wolfe 0eedb1c556
Added 307 redirects for old API endpoints
closes: https://github.com/TryGhost/Toolbox/issues/296

- This is a small change to permit any known API version to redirect to an unversioned URL
- We include v2 because although it should have been deleted in 5.0 anyway, in the spirit of the change away from versioned URLs there's
  absolutely no sense in forcing people to update clients that still work for no reason.
- We use a 307, because this preserves the original HTTP method, allowing POSTS, PUTs and DELETEs through as well as GETs
- We set the accept-version header on the redirect, meaning that for example with a request to the old /v4/ api, Ghost will respond as though
  the client sent `accept-version: v4.0` and if there are known breaking changes, it may choose to inform the admin and owner users of these
2022-04-28 15:37:14 +01:00
..
canary Renamed email-preview file to email-previews 2022-04-28 15:37:12 +01:00
middleware Replaced white/black list terminology 2022-04-19 11:19:59 +01:00
testmode Added guards against parentPort being null 2021-06-29 12:14:48 +01:00
app.js Added 307 redirects for old API endpoints 2022-04-28 15:37:14 +01:00
index.js