mirror of
https://github.com/usememos/memos.git
synced 2025-03-18 03:30:07 +01:00
fix: add charset=utf-8 for text content resources (#3608)
Co-authored-by: = <=>
This commit is contained in:
parent
ca463891f2
commit
4f4fe9b26b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user