Skip to content

Fix: Throw TypeError instead of sending invalid Location header on missing redirect URL - #7424

Closed
vjymisal0 wants to merge 1 commit into
expressjs:masterfrom
vjymisal0:fix-redirect-missing-url
Closed

Fix: Throw TypeError instead of sending invalid Location header on missing redirect URL#7424
vjymisal0 wants to merge 1 commit into
expressjs:masterfrom
vjymisal0:fix-redirect-missing-url

Conversation

@vjymisal0

Copy link
Copy Markdown

Resolves#6941. When
es.redirect() is called with undefined or a non-string argument, it now correctly throws a TypeError rather than falling through to send a malformed HTTP response with a Location: undefined header.

CopilotAI lite review requested due to automatic review settings August 19, 2026 12:47

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@krzysdz

Copy link
Copy Markdown
Contributor

Duplicate of#6404

@krzysdzkrzysdz marked this as a duplicate of #6404Aug 19, 2026
@krzysdzkrzysdz closed this Aug 19, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

res.redirect(undefined) sends invalid Location: undefined header

4 participants

@vjymisal0@krzysdz@vijay-loopr