-
Notifications
You must be signed in to change notification settings - Fork 4k
rabbitmq_tracing: explicitly specify UTF-8 encoding for served trace files (backport #14966) #14970
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
+49
−5
Conversation
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
(cherry picked from commit be75522) # Conflicts: # release-notes/4.3.0.md
- Replace timer:sleep(100) with await_condition/1 to wait for trace files instead of using fixed delays, making tests more reliable - Remove explicit close_channel calls for managed CT helper channels - Add http_get_headers/5 helper function following the same pattern as http_get/5 and http_get_raw/5, replacing direct req/4 calls - Use helper function to validate HTTP status codes and return headers consistently with the module's existing helper pattern (cherry picked from commit b606cc0)
Replace manual header setting with charsets_provided/2 callback to let Cowboy handle charset negotiation automatically. (cherry picked from commit c1cc495)
Author
|
Cherry-pick of be75522 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Collaborator
|
@Mergifyio backport v4.1.x |
Author
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Nov 19, 2025
(cherry picked from commit f5a7454)
12 tasks
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.
Set charset=utf-8 in Content-Type header to ensure proper display of Cyrillic and other Unicode characters in browsers.
Fixes #13952
Proposed Changes
This PR fixes incorrect encoding display for Cyrillic and other Unicode characters when viewing trace log files through the RabbitMQ management UI. The issue was that browsers were misinterpreting UTF-8 encoded content as Latin-1 when no charset was specified in the
Content-Typeheader.Why this change:
rabbit_tracing_consumer(usingio_lib:formatandrabbit_json:encode)Привет мир→Привет мир)charset=utf-8to theContent-Typeheader ensures browsers correctly interpret the file contentSolution chosen:
The original issue suggested a client-side JavaScript solution, but we implemented a server-side fix instead because:
about:blank)Types of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply.You can also fill these out after creating the PR.
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.mddocumentFurther Comments
Changes made:
deps/rabbitmq_tracing/src/rabbit_tracing_wm_file.erlto setContent-Type: text/plain; charset=utf-8header inserve/2trace_file_content_type_testindeps/rabbitmq_tracing/test/rabbit_tracing_SUITE.erlto verify the Content-Type header includes charsetWhy this is safe:
text/plain)rabbit_mgmt_oauth_bootstrap.erlsetstext/javascript; charset=utf-8)Testing:
text/plainandcharset=utf-8Before the fix:

After the fix:

This is an automatic backport of pull request #14966 done by [Mergify](https://mergify.com).