fix: add charset=utf-8 for text content resources (#3608)

Co-authored-by: = <=>
This commit is contained in:
Zeng1998 2024-06-24 23:01:19 +08:00 committed by GitHub
parent ca463891f2
commit 4f4fe9b26b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -210,8 +210,13 @@ func (s *APIV1Service) GetResourceBinary(ctx context.Context, request *v1pb.GetR
}
}
contentType := resource.Type
if strings.HasPrefix(contentType, "text/") {
contentType += "; charset=utf-8"
}
httpBody := &httpbody.HttpBody{
ContentType: resource.Type,
ContentType: contentType,
Data: blob,
}
return httpBody, nil