Add system console switch for enabling link previews (#5663)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
f99658152a
Коммит
e87f5c6cf9
@@ -452,6 +452,11 @@ func getFileInfosForPost(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func getOpenGraphMetadata(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if !*utils.Cfg.ServiceSettings.EnableLinkPreviews {
|
||||
c.Err = model.NewAppError("getOpenGraphMetadata", "api.post.link_preview_disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
}
|
||||
|
||||
props := model.StringInterfaceFromJson(r.Body)
|
||||
|
||||
ogJSONGeneric, ok := openGraphDataCache.Get(props["url"])
|
||||
|
||||
Ссылка в новой задаче
Block a user