Moving file response functionality to shared folder (#22226)

* Moving file response functionality to shared folder

* Linter fixes

* Added the attachment serve to shared folder

* Removed the unwanted logs

* import fixes

* Linter fixes

* License added

* Moved UnsafeContentTypes and MediaContentTypes from api4

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Rajat Dabade
2023-02-09 08:39:42 +05:30
коммит произвёл GitHub
родитель 3ae70591d0
Коммит 825b281f36
6 изменённых файлов: 105 добавлений и 89 удалений

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

@@ -14,6 +14,7 @@ import (
"github.com/mattermost/mattermost-server/v6/audit"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/shared/web"
)
func (api *API) InitCloud() {
@@ -647,7 +648,7 @@ func getSubscriptionInvoicePDF(c *Context, w http.ResponseWriter, r *http.Reques
return
}
writeFileResponse(
web.WriteFileResponse(
filename,
"application/pdf",
int64(binary.Size(pdfData)),