Skip to content

fix: prefer RFC 5987 filename* in hx-download - #4043

Open
manwithacat wants to merge 1 commit into
bigskysoftware:four-devfrom
manwithacat:fix/hx-download-utf8-filename
Open

fix: prefer RFC 5987 filename* in hx-download#4043
manwithacat wants to merge 1 commit into
bigskysoftware:four-devfrom
manwithacat:fix/hx-download-utf8-filename

Conversation

@manwithacat

@manwithacat manwithacat commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description

parseFilename() used /filename\*?=/, so the first filename= token won. When a server sent both an ASCII fallback and filename*=UTF-8''…, the UTF-8 name was ignored.

Corresponding issue: #4020

Demo: https://manwithacat.github.io/htmx/demos/hx-download-utf8-filename/

Testing

Added tests for dual filename= + filename* (the reported header) and filename* alone.

Local npm test (Chromium, same as CI htmx_tests): 87 files, 1740 passed, 0 failed, 5 skipped.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against four-dev
  • This is a bugfix for documented RFC 6266 / filename* behaviour
  • Full browser suite — CI; parseFilename unit-checked with the reporter's header

parseFilename() matched the first filename= token, so a UTF-8 filename*
was ignored when an ASCII filename= fallback was also present.

Closes bigskysoftware#4020
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.

1 participant