cmd/syncthing: set charset=utf-8 on migration API Content-Type (fixes #10499)#10648
Closed
harshitanand wants to merge 1 commit into
Closed
cmd/syncthing: set charset=utf-8 on migration API Content-Type (fixes #10499)#10648harshitanand wants to merge 1 commit into
harshitanand wants to merge 1 commit into
Conversation
…yncthing#10499) The migratingAPI handler set a bare "text/plain" Content-Type header, which per RFC 2046 implies US-ASCII. Syncthing log output may contain non-US-ASCII characters, so the header should explicitly declare UTF-8 to match the actual encoding used. Signed-off-by: Harshit Anand <harshitanand@users.noreply.github.com>
Merged
pull Bot
pushed a commit
to dudw/syncthing
that referenced
this pull request
Apr 22, 2026
... which keep getting filed by AI agents. Closes syncthing#10649, closes syncthing#10486, closes syncthing#10648, closes syncthing#10499, closes syncthing#10647, closes syncthing#10635, closes syncthing#10636, closes syncthing#10607. --------- Signed-off-by: Jakob Borg <jakob@kastelo.net>
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.
Linked Issue
Closes #10499
Description
The
migratingAPIhandler incmd/syncthing/main.goset a baretext/plainContent-Type header. Per RFC 2046, omitting thecharsetparameter implies US-ASCII. Syncthing log output may contain non-US-ASCII characters (e.g. Unicode in log messages), so the header should explicitly declare UTF-8.Fix: Change
"text/plain"to"text/plain; charset=utf-8"inmigratingAPI.Serve(). This is consistent with the regular API's/rest/system/log.txtendpoint (lib/api/api.go:1106) which already uses the correct value.Changes
cmd/syncthing/main.go: 1 character-set qualifier added to Content-Type stringType of Change
Testing
go test ./cmd/syncthing/...— 4 passed, 0 failed (using-tags noassetsfor local env)go build ./cmd/syncthing/— clean (pre-existingauto.Assetsenv constraint unrelated to this fix)