-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Polish HTML structure of the response in the res.redirect() function #5167
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
base: master
Are you sure you want to change the base?
Conversation
Your changes look good to me, you just missed the tests for the redirect body in |
Hi, I have updated the test file, could you review it again? Thank you! |
Looks good now, but I'm not the maintainer. |
Hi @Bernice55231, would you like to resolve the conflicts in this PR? |
Keep in mind GHSA-qw6h-vgh9-j6wx when handling this conflict to prevent regressions :) |
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
lib/response.js:840
- The string concatenation split into multiple lines may risk issues with automatic semicolon insertion in JavaScript; consider moving the '+' operator to the end of the preceding line to ensure the concatenation works as intended.
+ '<body><p>' + statuses.message[status] + '. Redirecting to ' + u + '</p></body>'
Fixed #5058
To prevent the issue of not showing the DOM body in the old-versioned browser or HTTPServer in redirecting method, it is better to have the
<!DOCTYPE html>' and
<title>` elements in the response body. If we use an old-versioned browser, it may not automatically fulfill the correct HTML file and thus show only plain text on that page if it does not succeed in redirecting.