fix(cli): printJSON 输出 URL 时 & 被转义为 \u0026#60
Merged
riba2534 merged 1 commit intoriba2534:mainfrom Mar 29, 2026
Merged
Conversation
Go 的 json.MarshalIndent 默认对 &、<、> 做 HTML 安全转义, 导致 `auth login --print-url` 输出的 auth_url 中 & 变为 \u0026, 用户无法直接复制使用。 改用 json.NewEncoder + SetEscapeHTML(false) 禁用 HTML 转义。 Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
printJSON使用json.MarshalIndent序列化时,Go 默认对&做 HTML 安全转义为\u0026,导致auth login --print-url输出的 auth_url 不可直接使用json.NewEncoder+SetEscapeHTML(false)禁用 HTML 转义Test plan
go build ./...编译通过go vet ./...静态检查通过go test ./...全部测试通过feishu-cli auth login --print-url验证 URL 中&不再被转义