Skip to content

feat: add deprecation notice for header overwriting in redirects #199

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 1 commit into
base: master
Choose a base branch
from

Conversation

bjohansebas
Copy link
Member

as title

@bjohansebas bjohansebas mentioned this pull request Mar 27, 2025
@@ -2,6 +2,7 @@
===================

* Changes from 1.16.0
* In the next major version, headers will no longer be overwritten when redirecting a directory.
Copy link
Contributor

Choose a reason for hiding this comment

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

v2.1.0 was already released. Please add a unreleased section or just add it in the Release PR

@Phillip9587
Copy link
Contributor

I’m against adding this check. I think it’s better to document the behavior in the next major release instead. The check negatively impacts performance by verifying the presence of the header with res.hasHeader() for each header every time a directory redirect occurs.

Revert PR: #200

@@ -9,6 +9,7 @@
"encodeurl": "^2.0.0",
"escape-html": "^1.0.3",
"parseurl": "^1.3.3",
"depd": "^2.0.0",
Copy link
Member

Choose a reason for hiding this comment

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

This should go in the HISTORY.md too

@bjohansebas
Copy link
Member Author

I really wonder if the user can send those headers. From what I understand of the code, I see that it is not possible, so neither this nor the previous PR was necessary.

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

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

I would prefer we go with #200. Backing it out is safer than deprecating. We can always follow up with a minor that deprecates it or figure out a way to do it that we would consider non-breaking. We should probably not close this though, so that we could land it after we do the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants