-
-
Notifications
You must be signed in to change notification settings - Fork 128
fix(content-disposition): allow empty filename without throwing error #466
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
ItayLeon-Max
wants to merge
5
commits into
tinyhttp:master
Choose a base branch
from
ItayLeon-Max:fix-empty-filename-content-disposition
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix(content-disposition): allow empty filename without throwing error #466
ItayLeon-Max
wants to merge
5
commits into
tinyhttp:master
from
ItayLeon-Max:fix-empty-filename-content-disposition
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
talentlessguy
requested changes
Apr 29, 2025
refactor(content-disposition): simplify empty filename handling Co-authored-by: v1rtl <hi@v1rtl.site>
Hope you’re doing well! Thanks again for your guidance! |
talentlessguy
requested changes
Apr 29, 2025
e14b703
to
24b588c
Compare
24b588c
to
ce7eb85
Compare
talentlessguy
requested changes
May 8, 2025
@@ -22,6 +22,7 @@ | |||
}, | |||
"dependencies": { | |||
"@tinyhttp/accepts": "workspace:*", | |||
"@tinyhttp/req": "workspace:^", |
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 do you add the package to itself?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request fixes an issue in the @tinyhttp/content-disposition package where parsing a Content-Disposition header with an empty filename would incorrectly throw an invalid extended field value error.
Now, if the filename* parameter value is empty, it will be properly handled and parsed as an empty string ('') instead of causing an exception.
This behavior aligns with the expectation that an empty filename is valid per the relevant RFC standards.
Changes:
• Updated parse function to treat empty extended parameters correctly.
• Adjusted decodefield to return an empty string when input is empty.
• Added safeguard for handling empty filename* values without throwing.
Impact:
This change ensures better compliance with the Content-Disposition specification and prevents runtime errors when dealing with empty filenames.