Skip to content

fix: Ensure Content-Disposition Header conforms to RFC6266 #735

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

Merged
merged 1 commit into from
Aug 4, 2025

Conversation

sh41
Copy link
Contributor

@sh41 sh41 commented Jul 24, 2025

What kind of change does this PR introduce?

Bug fix.

What is the current behavior?

When a filename is specified, the content-disposition header is added. Currently the header will have content like this:

attachment; filename=file.txt; filename*=UTF-8''file.txt;

RFC6266 specifies the valid formats for this header, and a trailing semi-colon is not allowed per the grammar at https://datatracker.ietf.org/doc/html/rfc6266#page-4

I was prompted to raise this PR when I ran into the same issue discussed here: jshttp/content-disposition#11

What is the new behavior?

The PR removes the trailing semi-colon and updates the test for it.

attachment; filename=file.txt; filename*=UTF-8''file.txt

@sh41 sh41 changed the title Ensure Content-Disposition Header conforms to RFC6266 fix: Ensure Content-Disposition Header conforms to RFC6266 Jul 24, 2025
@fenos
Copy link
Contributor

fenos commented Aug 4, 2025

Thanks a lot, @sh41, good catch!

@fenos fenos enabled auto-merge (squash) August 4, 2025 12:03
@fenos fenos merged commit 694a0e4 into supabase:master Aug 4, 2025
1 of 2 checks passed
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