MM-11272 Add OpenGraph and image dimension metadata to posts (#9313)

* Move OpenGraph code into its own file

* Move OpenGraph image proxying to app layer

* Move test file code out of api4 package

* MM-11272 Add OpenGraph and image dimension metadata to posts
Этот коммит содержится в:
Harrison Healey
2018-09-04 08:33:29 -04:00
родитель 48f16b6401
Коммит 2959b53d98
16 изменённых файлов: 819 добавлений и 285 удалений

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

@@ -4,7 +4,6 @@
package api4
import (
"bytes"
"fmt"
"io"
"io/ioutil"
@@ -746,22 +745,6 @@ func CheckInternalErrorStatus(t *testing.T, resp *model.Response) {
}
}
func readTestFile(name string) ([]byte, error) {
path, _ := utils.FindDir("tests")
file, err := os.Open(filepath.Join(path, name))
if err != nil {
return nil, err
}
defer file.Close()
data := &bytes.Buffer{}
if _, err := io.Copy(data, file); err != nil {
return nil, err
} else {
return data.Bytes(), nil
}
}
// Similar to s3.New() but allows initialization of signature v2 or signature v4 client.
// If signV2 input is false, function always returns signature v4.
//