MM-49627: Suppress transformation of embedded images via image proxy (#24401)

There was no check for embedded images which made "copy text" paste
the siteURL instead of the actual image content.

This does not change the behavior of actually rendering the image
which is how other sites behave as well.

https://mattermost.atlassian.net/browse/MM-49627
```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2023-08-30 22:33:42 +05:30
коммит произвёл GitHub
родитель fc9a9d1d41
Коммит b84236d555
3 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@@ -66,6 +66,11 @@ func TestGetProxiedImageURL(t *testing.T) {
Input: "https://mattermost.example.com@anothersite.com/static/logo.png",
Expected: "https://mattermost.example.com/api/v4/image?url=https%3A%2F%2Fmattermost.example.com%40anothersite.com%2Fstatic%2Flogo.png",
},
{
Name: "should not proxy embedded image",
Input: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
Expected: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
},
} {
t.Run(test.Name, func(t *testing.T) {
assert.Equal(t, test.Expected, proxy.GetProxiedImageURL(test.Input))