Skip to content

Specify behavior when only slashes or backslashes are passed as filename parameter#120

Draft
Phillip9587 wants to merge 1 commit intojshttp:masterfrom
Phillip9587:basename-only-slashes
Draft

Specify behavior when only slashes or backslashes are passed as filename parameter#120
Phillip9587 wants to merge 1 commit intojshttp:masterfrom
Phillip9587:basename-only-slashes

Conversation

@Phillip9587
Copy link
Contributor

I'm opening this PR to discuss how we should handle filenames consisting only of slashes or backslashes. When a filename contains only slashes, the function returns an invalid header in my opinion:

attachment; filename*=UTF-8''

Is this the desired behavior, or should we handle it differently? Should we add explicit validation to reject invalid filenames?

@blakeembrey
Copy link
Member

Is this the desired behavior, or should we handle it differently?

I think it's fine and an expected edge-case.

Should we add explicit validation to reject invalid filenames?

This is the more interesting question. Additionally, should we even basename file name at all? I'm not confident at this time to validate file names, since MacOS supports / and \ in their filenames (which must be breaking today if someone tried to specify it as filename.

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.

2 participants