Skip to content

net/gclient: gclient downloads pictures, causing observable reporting. The tracingEventHttpResponseBody body is not utf8, causing tracking loss. #3791

@ivothgle

Description

@ivothgle

Go version

1.22

GoFrame version

2.7.0

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

开启链路跟踪

g.Client().GetBytes(ctx, "http://a.com/jpg")

然后就报 string field contains invalid UTF-8 了

主要原因是这里获取到了非文本内容导致的

resBodyContent, err := gtrace.SafeContentForHttp(reqBodyContentBytes, response.Header)
if err != nil {
    span.SetStatus(codes.Error, fmt.Sprintf(`converting safe content failed: %s`, err.Error()))
}

What did you see happen?

希望可以提供自定义修改或忽略

What did you expect to see?

然后就报 string field contains invalid UTF-8 了

Metadata

Metadata

Assignees

Labels

bugIt is confirmed a bug, but don't worry, we'll handle it.doneThis issue is done, which may be release in next version.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions