summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api/post.go b/api/post.go
index 9c22dc5ee..4e7801e2b 100644
--- a/api/post.go
+++ b/api/post.go
@@ -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"])