mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-24 13:43:12 +02:00
Used Shared resource from MM-server for attachment serving (#4542)
* Used Shared resource for File Handling * Making use of shared attachment serve functionality * Added license --------- Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
fe515f6c82
commit
c91a67fbe6
@ -1,3 +1,6 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
@ -17,6 +20,7 @@ import (
|
||||
mmModel "github.com/mattermost/mattermost-server/v6/model"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
"github.com/mattermost/mattermost-server/v6/shared/web"
|
||||
)
|
||||
|
||||
// FileUploadResponse is the response to a file upload
|
||||
@ -166,7 +170,7 @@ func (a *API) handleServeFile(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
defer fileReader.Close()
|
||||
http.ServeContent(w, r, filename, time.Now(), fileReader)
|
||||
web.WriteFileResponse(filename, fileInfo.MimeType, fileInfo.Size, time.Now(), "", fileReader, false, w, r)
|
||||
auditRec.Success()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user