2022-11-29 10:37:57AM
This commit is contained in:
parent
ff02459402
commit
97f7679797
1 changed files with 2 additions and 2 deletions
|
|
@ -114,7 +114,7 @@ func fetch(ctx context.Context, href string) (string, error) {
|
||||||
mimeType := http.DetectContentType(data)
|
mimeType := http.DetectContentType(data)
|
||||||
mimeType = strings.Replace(mimeType, "text/xml", "image/svg+xml", 1)
|
mimeType = strings.Replace(mimeType, "text/xml", "image/svg+xml", 1)
|
||||||
|
|
||||||
enc := base64.StdEncoding.EncodeToString(data)
|
enc := base64.URLEncoding.EncodeToString(data)
|
||||||
|
|
||||||
return fmt.Sprintf("data:%s;base64,%s", mimeType, enc), nil
|
return fmt.Sprintf("data:%s;base64,%s", mimeType, enc), nil
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ func read(ctx context.Context, href string) (string, error) {
|
||||||
mimeType := http.DetectContentType(data)
|
mimeType := http.DetectContentType(data)
|
||||||
mimeType = strings.Replace(mimeType, "text/xml", "image/svg+xml", 1)
|
mimeType = strings.Replace(mimeType, "text/xml", "image/svg+xml", 1)
|
||||||
|
|
||||||
enc := base64.StdEncoding.EncodeToString(data)
|
enc := base64.URLEncoding.EncodeToString(data)
|
||||||
|
|
||||||
return fmt.Sprintf("data:%s;base64,%s", mimeType, enc), nil
|
return fmt.Sprintf("data:%s;base64,%s", mimeType, enc), nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue