feat: Upgrade to express 5.0.1 (#9530)
BREAKING CHANGE: This upgrades the internally used Express framework from version 4 to 5, which may be a breaking change. If Parse Server is set up to be mounted on an Express application, we recommend to also use version 5 of the Express framework to avoid any compatibility issues. Note that even if there are no issues after upgrading, future releases of Parse Server may introduce issues if Parse Server internally relies on Express 5-specific features which are unsupported by the Express version on which it is mounted. See the Express [migration guide](https://expressjs.com/en/guide/migrating-5.html) and [release announcement](https://expressjs.com/2024/10/15/v5-release.html#breaking-changes) for more info.
This commit is contained in:
@@ -107,8 +107,8 @@ export class PagesRouter extends PromiseRouter {
|
||||
|
||||
resendVerificationEmail(req) {
|
||||
const config = req.config;
|
||||
const username = req.body.username;
|
||||
const token = req.body.token;
|
||||
const username = req.body?.username;
|
||||
const token = req.body?.token;
|
||||
|
||||
if (!config) {
|
||||
this.invalidRequest();
|
||||
@@ -178,7 +178,7 @@ export class PagesRouter extends PromiseRouter {
|
||||
this.invalidRequest();
|
||||
}
|
||||
|
||||
const { new_password, token: rawToken } = req.body;
|
||||
const { new_password, token: rawToken } = req.body || {};
|
||||
const token = rawToken && typeof rawToken !== 'string' ? rawToken.toString() : rawToken;
|
||||
|
||||
if ((!token || !new_password) && req.xhr === false) {
|
||||
@@ -320,7 +320,7 @@ export class PagesRouter extends PromiseRouter {
|
||||
*/
|
||||
staticRoute(req) {
|
||||
// Get requested path
|
||||
const relativePath = req.params[0];
|
||||
const relativePath = req.params['resource'][0];
|
||||
|
||||
// Resolve requested path to absolute path
|
||||
const absolutePath = path.resolve(this.pagesPath, relativePath);
|
||||
@@ -716,7 +716,7 @@ export class PagesRouter extends PromiseRouter {
|
||||
mountStaticRoute() {
|
||||
this.route(
|
||||
'GET',
|
||||
`/${this.pagesEndpoint}/(*)?`,
|
||||
`/${this.pagesEndpoint}/*resource`,
|
||||
req => {
|
||||
this.setConfig(req, true);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user