1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-07-15 23:54:29 +02:00

Adding gif support for boards (#2126)

* Adding gif support for boards

* Updating api
This commit is contained in:
Asaad Mahmood
2022-01-26 18:45:44 +05:00
committed by GitHub
parent 2278895217
commit 4662b03501
2 changed files with 6 additions and 1 deletions

View File

@ -1320,6 +1320,7 @@ func (a *API) handleServeFile(w http.ResponseWriter, r *http.Request) {
// - application/json // - application/json
// - image/jpg // - image/jpg
// - image/png // - image/png
// - image/gif
// parameters: // parameters:
// - name: workspaceID // - name: workspaceID
// in: path // in: path
@ -1370,6 +1371,10 @@ func (a *API) handleServeFile(w http.ResponseWriter, r *http.Request) {
contentType = "image/png" contentType = "image/png"
} }
if fileExtension == "gif" {
contentType = "image/gif"
}
w.Header().Set("Content-Type", contentType) w.Header().Set("Content-Type", contentType)
fileReader, err := a.app.GetFileReader(workspaceID, rootID, filename) fileReader, err := a.app.GetFileReader(workspaceID, rootID, filename)

View File

@ -56,7 +56,7 @@ contentRegistry.registerContentType({
block.fields.fileId = fileId || '' block.fields.fileId = fileId || ''
resolve(block) resolve(block)
}, },
'.jpg,.jpeg,.png') '.jpg,.jpeg,.png,.gif')
}, },
) )