Skip to content
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

[23.0 backport] daemon/config: ignore UTF-8 BOM in config JSON #44777

Merged
merged 2 commits into from Jan 10, 2023

Conversation

thaJeztah
Copy link
Member

- What I did
Strip a BOM when present in the config JSON.

RFC 8259 allows for JSON implementations to optionally ignore a BOM when it helps with interoperability; do so in Moby as Notepad (the only text editor available out of the box in many versions of Windows server) insists on writing UTF-8 with a BOM.

- How I did it
bytes.TrimPrefix

- How to verify it
Unit tests.

- Description for the changelog

  • Moby now accepts config JSON files with a UTF-8 byte order mark present.

- A picture of a cute animal (not mandatory but encouraged)
beardy

[RFC 8259] allows for JSON implementations to optionally ignore a BOM
when it helps with interoperability; do so in Moby as Notepad (the only
text editor available out of the box in many versions of Windows Server)
insists on writing UTF-8 with a BOM.

  [RFC 8259]: https://tools.ietf.org/html/rfc8259#section-8.1

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit bb19265)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
(cherry picked from commit cba3edb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. impact/changelog area/daemon labels Jan 10, 2023
@thaJeztah thaJeztah added this to the 23.0.0 milestone Jan 10, 2023
@thaJeztah
Copy link
Member Author

@neersighted @vvoland ptal (cherry-pick was clean)

@neersighted neersighted merged commit d29ab75 into moby:23.0 Jan 10, 2023
@thaJeztah thaJeztah deleted the 23.0_backport_ignore_bom branch January 10, 2023 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/daemon impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants