File tree 3 files changed +6
-3
lines changed 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,8 @@ func CreateReleaseAttachment(ctx *context.APIContext) {
183
183
allowed := false
184
184
for _ , t := range allowedTypes {
185
185
t := strings .Trim (t , " " )
186
- if t == "*/*" || t == fileType {
186
+ if t == "*/*" || t == fileType ||
187
+ strings .HasPrefix (fileType , t + ";" ) {
187
188
allowed = true
188
189
break
189
190
}
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ func UploadAttachment(ctx *context.Context) {
48
48
allowed := false
49
49
for _ , t := range allowedTypes {
50
50
t := strings .Trim (t , " " )
51
- if t == "*/*" || t == fileType {
51
+ if t == "*/*" || t == fileType ||
52
+ strings .HasPrefix (fileType , t + ";" ) {
52
53
allowed = true
53
54
break
54
55
}
Original file line number Diff line number Diff line change @@ -628,7 +628,8 @@ func UploadFileToServer(ctx *context.Context) {
628
628
allowed := false
629
629
for _ , t := range setting .Repository .Upload .AllowedTypes {
630
630
t := strings .Trim (t , " " )
631
- if t == "*/*" || t == fileType {
631
+ if t == "*/*" || t == fileType ||
632
+ strings .HasPrefix (fileType , t + ";" ) {
632
633
allowed = true
633
634
break
634
635
}
You can’t perform that action at this time.
0 commit comments