Skip to content

Conversation

@fhennig
Copy link
Contributor

@fhennig fhennig commented Feb 11, 2026

resolves #1494

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

fhennig and others added 2 commits February 11, 2026 10:43
Replace custom RFC 5987 encoding with Spring's built-in ContentDisposition builder. This reduces maintenance burden by leveraging Spring's well-tested implementation while adding dual parameter support (filename= and filename*=) for maximum browser compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
The plain filename= parameter now contains only ASCII characters (code < 128) for maximum compatibility with legacy systems. Non-ASCII characters are removed entirely. The filename*= parameter continues to provide full UTF-8 support via RFC 5987 encoding.

Examples:
- données.json → filename=donnes.json; filename*=UTF-8''donn%C3%A9es.json
- 测试.json → filename=.json; filename*=UTF-8''%E6%B5%8B%E8%AF%95.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lapis Ready Ready Preview, Comment Feb 11, 2026 10:36am

Request Review

@fhennig fhennig self-assigned this Feb 11, 2026
@fhennig fhennig changed the title Use Spring ContentDisposition for filename encoding feat(lapis): support filename* with UTF-8 character encoding Feb 11, 2026
@fhennig fhennig force-pushed the feat/spring-content-disposition branch from 3e97b88 to b9b3ea8 Compare February 11, 2026 10:23
@fhennig fhennig marked this pull request as ready for review February 11, 2026 10:23
Extract duplicated Content-Disposition generation logic from DownloadAsFileFilter and LapisControllerDownloadAsFileTest into a shared utility (ContentDispositionUtils.kt). This eliminates ~30 lines of code duplication and provides a single source of truth for filename encoding.

Changes:
- Add ContentDispositionUtils.kt with generateContentDisposition() and toAsciiFilename()
- Add ContentDispositionUtilsTest.kt with comprehensive test coverage
- Refactor DownloadAsFileFilter.kt to use utility (15 lines → 3 lines)
- Refactor LapisControllerDownloadAsFileTest.kt to use utility (19 lines → 3 lines)
- Remove unused imports from both files

Benefits:
- Single source of truth for Content-Disposition logic
- Easier maintenance (changes in one place)
- Better testability (utility tested independently)
- Cleaner code structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
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.

Use filename* in Content-Disposition

1 participant