WPB-24669 [fix] upload of files with umlaut when audit log enabled - #5359
Merged
battermann merged 6 commits intoJul 22, 2026
Conversation
battermann
marked this pull request as ready for review
July 22, 2026 11:35
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes asset uploads failing for non-ASCII filenames (e.g. umlauts) when audit logging is enabled by percent-encoding the audit-log JSON metadata before putting it into S3 user-metadata headers, and decoding it when reading metadata back.
Changes:
- Percent-encode audit-log metadata for S3 headers and URL-decode it on read-back.
- Add a unit (QuickCheck) regression test ensuring produced S3 metadata header values are ASCII even with umlaut filenames.
- Wire the new test module into the cargohold unit test suite and add a changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| services/cargohold/src/CargoHold/S3.hs | Encode audit-log metadata as percent-encoded ASCII for S3 headers; decode when reading metadata back. |
| services/cargohold/test/unit/Test/CargoHold/S3Test.hs | Adds a QuickCheck property asserting the metadata header value remains ASCII for umlaut filenames. |
| services/cargohold/test/unit/Main.hs | Registers the new S3 unit tests in the test runner. |
| services/cargohold/cargohold.cabal | Adds the new test module to the test-suite’s other-modules. |
| changelog.d/3-bug-fixes/WPB-24669 | Documents the bug fix and the encoding/decoding approach. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
services/cargohold/src/CargoHold/S3.hs:431
decodePercentEncodedusesdecodeLatin1on the percent-decoded bytes and thenparseJSONre-encodes withencodeUtf8. For non-ASCII filenames this corrupts the original UTF-8 JSON bytes (bytes >= 0x80 become multi-byte UTF-8), so percent-encoded audit-log metadata cannot be decoded correctly.
A simpler and correct approach is to parse JSON directly from the strict ByteString (either the raw header bytes, or the urlDecoded bytes) and avoid the Text roundtrip.
parseJSON :: Text -> Maybe AssetAuditLogMetadata
parseJSON = A.decode . fromStrict . encodeUtf8
decodePercentEncoded :: Text -> Text
decodePercentEncoded = decodeLatin1 . HTTPURI.urlDecode False . encodeUtf8
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
blackheaven
approved these changes
Jul 22, 2026
battermann
deleted the
WPB-24669-backend-upload-of-files-with-umlaut-not-possible-on-most-operating-systems
branch
July 22, 2026 15:05
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
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.
https://wearezeta.atlassian.net/browse/WPB-24669
Checklist
changelog.d