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

KS-61 修复Windows/Web平台的不兼容报错 #95

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

zhangzqs
Copy link

@zhangzqs zhangzqs commented Dec 25, 2024

分析:

  • 这两个问题实际上都是生成User-Agent中的逻辑出现了问题
  • windows平台上是由于UA包含了中文,而http header中出现中文导致了报错
  • web平台上是由于新引入的库sysinfo2不支持web平台

解决方案:

  • 引入platform_info库,加入平台判定逻辑,web平台不使用SysInfo2生成UA
  • 对整个platform_info和SysInfo2库添加异常处理,不支持的平台默认降级为QiniuDart/vx (Unknow
  • 对最终生成的UA字符串仅保留ascii编码字符,其余字符均移除,防止windows平台的报错

额外改动:

  • 使用mixin,新版dart的一些语法特性,重构example的代码
  • 优化Example的用户交互逻辑
  • 补充windows和web平台代码

Copy link
Collaborator

@yinxulai yinxulai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhangzqs zhangzqs changed the title KS-61 修复Web平台的不兼容报错 KS-61 修复Windows/Web平台的不兼容报错 Jan 6, 2025
Copy link
Collaborator

@yinxulai yinxulai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

2 participants