@@ -2,12 +2,10 @@ package r0
2
2
3
3
import (
4
4
"errors"
5
- "io"
6
5
"net/http"
7
6
"path/filepath"
8
7
9
8
"github.com/getsentry/sentry-go"
10
- "github.com/h2non/filetype"
11
9
"github.com/sirupsen/logrus"
12
10
"github.com/t2bot/matrix-media-repo/api/_apimeta"
13
11
"github.com/t2bot/matrix-media-repo/api/_responses"
@@ -59,15 +57,15 @@ func UploadMediaAsync(r *http.Request, rctx rcontext.RequestContext, user _apime
59
57
}
60
58
61
59
// GK-CUSTOMIZATION: Check if the file type is supported
62
- buf , _ := io .ReadAll (r .Body )
63
- kind , _ := filetype .Match (buf )
64
- if ! isSupportedFileType (kind .Extension ) {
65
- return & _responses.ErrorResponse {
66
- Code : common .ErrCodeBadRequest ,
67
- Message : "Unsupported file type." ,
68
- InternalCode : common .ErrCodeBadRequest ,
69
- }
70
- }
60
+ // buf, _ := io.ReadAll(r.Body)
61
+ // kind, _ := filetype.Match(buf)
62
+ // if !isSupportedFileType(kind.Extension) {
63
+ // return &_responses.ErrorResponse{
64
+ // Code: common.ErrCodeBadRequest,
65
+ // Message: "Unsupported file type.",
66
+ // InternalCode: common.ErrCodeBadRequest,
67
+ // }
68
+ // }
71
69
72
70
rctx = rctx .LogWithFields (logrus.Fields {
73
71
"mediaId" : mediaId ,
0 commit comments