fix: add locale to avoid wrong yggdrasil server name #2521
Merged
+3
−1
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.
问题描述
使用 HMCL 添加外置登录时,外置登录服务端名称显示为 Blessing Skin,而非在 Blessing Skin 后台设置的中文站点名称。从浏览器访问 https://skin.akashic.cc/api/yggdrasil/ 时,

serverName
正常故障分析
Blessing Skin 支持在不同的语言环境下启用不同的站点名称,如果请求头中没有
Accept-Language
则按照 en 处理。而 HMCL 中从 yggdrasil-api 获取服务端信息时并未添加Accept-Language
,导致显示站点英文名称考虑到使用 Blessing Skin 的用户有很大一部分来自中国,他们在皮肤站后台设置时可能没有设置英文站点名称,导致在 HMCL 中显示为默认英文名称 Blessing Skin
修复
在 HMCL 请求中添加
Accept-Language