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

fix: add locale to avoid wrong yggdrasil server name #2521

Merged
merged 3 commits into from
Mar 23, 2024

Conversation

Mythologyli
Copy link
Contributor

问题描述

使用 HMCL 添加外置登录时,外置登录服务端名称显示为 Blessing Skin,而非在 Blessing Skin 后台设置的中文站点名称。从浏览器访问 https://skin.akashic.cc/api/yggdrasil/ 时,serverName 正常
image

故障分析

Blessing Skin 支持在不同的语言环境下启用不同的站点名称,如果请求头中没有 Accept-Language 则按照 en 处理。而 HMCL 中从 yggdrasil-api 获取服务端信息时并未添加 Accept-Language,导致显示站点英文名称

考虑到使用 Blessing Skin 的用户有很大一部分来自中国,他们在皮肤站后台设置时可能没有设置英文站点名称,导致在 HMCL 中显示为默认英文名称 Blessing Skin

修复

在 HMCL 请求中添加 Accept-Language

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@Glavo
Copy link
Member

Glavo commented Sep 22, 2023

添加 Accept-Language 可能导致服务器返回 406

@burningtnt
Copy link
Member

添加 Accept-Language 可能导致服务器返回 406

优先带 Accept-Language Header,当收到 406 后再 fallback 回原来的方案?

@Mythologyli
Copy link
Contributor Author

Mythologyli commented Sep 25, 2023

不知道这个 PR 有没有必要
会不会在 Blessing Skin 那边提示用户将默认语言设为中文或者修改英文标题比较好
image
Blessing Skin 改英文标题需要先把语言换成英文再改,大多数用户可能不会想到,即使想到了可能也不太能意识到不修改英文标题会影响在 HMCL 中的显示

Glavo added 2 commits March 23, 2024 14:15

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…r-name

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@Glavo Glavo merged commit 1605eb1 into HMCL-dev:main Mar 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants