MM-17609 Add EnableSVGs setting (#11874)
* MM-17609 Add EnableSVGs setting * MM-17609 Return SVG images in post metadata
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9b61506c7d
Коммит
23ef7d9a62
@@ -495,7 +495,13 @@ func cacheLinkMetadata(requestURL string, timestamp int64, og *opengraph.OpenGra
|
||||
}
|
||||
|
||||
func (a *App) parseLinkMetadata(requestURL string, body io.Reader, contentType string) (*opengraph.OpenGraph, *model.PostImage, error) {
|
||||
if strings.HasPrefix(contentType, "image") {
|
||||
if contentType == "image/svg+xml" {
|
||||
image := &model.PostImage{
|
||||
Format: "svg",
|
||||
}
|
||||
|
||||
return nil, image, nil
|
||||
} else if strings.HasPrefix(contentType, "image") {
|
||||
image, err := parseImages(io.LimitReader(body, MaxMetadataImageSize))
|
||||
return nil, image, err
|
||||
} else if strings.HasPrefix(contentType, "text/html") {
|
||||
|
||||
Ссылка в новой задаче
Block a user