@@ -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"
@@ -58,16 +56,18 @@ func UploadMediaAsync(r *http.Request, rctx rcontext.RequestContext, user _apime
58
56
}
59
57
}
60
58
61
- // 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
- }
59
+ // // GK-CUSTOMIZATION: Check if the file type is supported
60
+ // buf, _ := io.ReadAll(r.Body)
61
+ // kind, _ := filetype.Match(buf)
62
+ // rctx.Log.Error("🔊 File type: ", kind)
63
+ // if !isSupportedFileType(kind.Extension) {
64
+ // rctx.Log.Error("🔊 unsupported file type")
65
+ // return &_responses.ErrorResponse{
66
+ // Code: common.ErrCodeBadRequest,
67
+ // Message: "Unsupported file type.",
68
+ // InternalCode: common.ErrCodeBadRequest,
69
+ // }
70
+ // }
71
71
72
72
rctx = rctx .LogWithFields (logrus.Fields {
73
73
"mediaId" : mediaId ,
0 commit comments