MM-14686 Send all image proxy requests through /api/v4/image (#10775)
* MM-14686 Implement /api/v4/image when proxy is disabled * MM-14686 Send all image proxy requests through /api/v4/image * Update unit tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4552c20d5b
Коммит
dce6cb601f
@@ -12,10 +12,11 @@ func (api *API) InitImage() {
|
||||
}
|
||||
|
||||
func getImage(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if !*c.App.Config().ImageProxySettings.Enable {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
url := r.URL.Query().Get("url")
|
||||
|
||||
c.App.ImageProxy.GetImage(w, r, r.URL.Query().Get("url"))
|
||||
if *c.App.Config().ImageProxySettings.Enable {
|
||||
c.App.ImageProxy.GetImage(w, r, url)
|
||||
} else {
|
||||
http.Redirect(w, r, url, http.StatusFound)
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user