Skip to content

feat(res.redirect): add validation for url and status arguments #6404

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bjohansebas
Copy link
Member

Validations are being added, this would ideally be for Express 6. Maybe sending a deprecation message would be great, what do you think?

closes #6391

@UlisesGascon UlisesGascon added the semver-major This change is a semver major label Mar 18, 2025
Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is a good idea, but we will need to introduce the deprecation notice in 5.x before merging this PR 🤔

var app = express();

app.use(function (req, res) {
res.redirect("300", 'http://google.com')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
res.redirect("300", 'http://google.com')
res.redirect("300", 'https://google.com')

http -> https

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not bad, but also just to be clear it is not necessary in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.x enhancement semver-major This change is a semver major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throw when the path is undefined in res.redirect.
4 participants