MM-23185 - Markdown image hosted by plugins are not shown if l… (#14185)
* avoid image proxy for local images * added test for local images
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
005cc00ccc
Коммит
52c92d6659
@@ -91,5 +91,14 @@ func TestGetImage(t *testing.T) {
|
||||
respBody, err := ioutil.ReadAll(resp.Body)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "success", string(respBody))
|
||||
|
||||
// local images should not be proxied, but forwarded
|
||||
r, err = http.NewRequest("GET", th.Client.ApiUrl+"/image?url=/plugins/test/image.png", nil)
|
||||
require.NoError(t, err)
|
||||
r.Header.Set(model.HEADER_AUTH, th.Client.AuthType+" "+th.Client.AuthToken)
|
||||
|
||||
resp, err = th.Client.HttpClient.Do(r)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, http.StatusFound, resp.StatusCode)
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user