-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(hostname): fix handling of non-ASCII hostnames on Windows #3382
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3382 +/- ##
==========================================
- Coverage 11.05% 10.90% -0.16%
==========================================
Files 99 99
Lines 17237 17247 +10
Branches 8036 8044 +8
==========================================
- Hits 1905 1880 -25
- Misses 12643 12809 +166
+ Partials 2689 2558 -131
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: ReenigneArcher <[email protected]>
Tested locally with hostname containing |
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Description
boost::asio::ip::host_name()
usesgethostname()
under the hood on Windows, which returns characters in the OEM codepage (though Boost does not document this anywhere). This isn't what Sunshine is expecting, so it misinterprets the output as UTF-8 and writes potentially invalid characters into the/serverinfo
response.Other platforms use UTF-8 as their 8-bit string representation, so they should be fine to still call
boost::asio::ip::host_name()
.Screenshot
Issues Fixed or Closed
Fixes #3381
Type of Change
.github/...
)Checklist