-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Upgrade to express 5.0.1 #9390
Conversation
- Changed some methods to match express 5.0 requirements - Changed PagesRouter.spec.js (req.query is now a getter) - Bumped express to v5 Review and testing required ! Closing #9353 Please enter the commit message for your changes. Lines starting
Thanks for opening this pull request! |
@@ -244,9 +244,8 @@ export class FilesRouter { | |||
} | |||
// run afterSaveFile trigger | |||
await triggers.maybeRunFileTrigger(triggers.Types.afterSave, fileObject, config, req.auth); | |||
res.status(201); | |||
res.status(201).json(saveResult); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you retuning saveResult
directly? The code before your change has only been returning a Location
key?
@@ -299,11 +298,9 @@ export class FilesRouter { | |||
const { filesController } = config; | |||
const { filename } = req.params; | |||
const data = await filesController.getMetadata(filename); | |||
res.status(200); | |||
res.json(data); | |||
res.status(200).json(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes necessary? If not, please revert.
@@ -31,7 +31,7 @@ | |||
"commander": "12.1.0", | |||
"cors": "2.8.5", | |||
"deepcopy": "2.1.0", | |||
"express": "4.21.0", | |||
"express": "^5.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert package.json and package-lock.json and then run npm i -E [email protected]
await verifyEmail(req); | ||
expect(goToPage.calls.all()[0].args[1]).toBe(pages.emailVerificationLinkInvalid); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert these dirty lines
req.query.locale = 'yo-LO'; | ||
|
||
const queryWithLocale = { ...req.query, locale: 'yo-LO' }; | ||
req = { ...req, query: queryWithLocale }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks strange, what are you trying to do there?
}); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and here?
@xooolod Before you submit your PR for review, please run the tests locally to see whether they all pass. This makes it easier for you to spot errors. |
Pull Request
Issue
Review and testing required !
Closes: #9353
Approach
Tasks