Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AStA
Erstitüte Backend
Commits
35c7c653
Commit
35c7c653
authored
Apr 01, 2021
by
Leon Tappe
🔥
Browse files
allow image/webp in UploadController
parent
522fb41d
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/controller/upload_controller.dart
View file @
35c7c653
...
@@ -10,9 +10,12 @@ const Map<List<int>, String> supportedTypes = <List<int>, String>{
...
@@ -10,9 +10,12 @@ const Map<List<int>, String> supportedTypes = <List<int>, String>{
[
0x89
,
0x50
,
0x4E
,
0x47
,
0x0D
,
0x0A
,
0x1A
,
0x0A
]:
'image/png'
,
[
0x89
,
0x50
,
0x4E
,
0x47
,
0x0D
,
0x0A
,
0x1A
,
0x0A
]:
'image/png'
,
[
0x47
,
0x49
,
0x46
,
0x38
]:
'image/gif'
,
[
0x47
,
0x49
,
0x46
,
0x38
]:
'image/gif'
,
[
0x42
,
0x4D
]:
'image/bmp'
,
[
0x42
,
0x4D
]:
'image/bmp'
,
[
0x52
,
0x49
,
0x46
,
0x46
]:
'image/webp'
,
};
};
class
UploadController
extends
ResourceController
{
class
UploadController
extends
ResourceController
{
MimeTypeResolver
mimeChecker
;
UploadController
()
{
UploadController
()
{
mimeChecker
=
MimeTypeResolver
();
mimeChecker
=
MimeTypeResolver
();
supportedTypes
.
forEach
(
mimeChecker
.
addMagicNumber
);
supportedTypes
.
forEach
(
mimeChecker
.
addMagicNumber
);
...
@@ -21,8 +24,6 @@ class UploadController extends ResourceController {
...
@@ -21,8 +24,6 @@ class UploadController extends ResourceController {
.
toList
();
.
toList
();
}
}
MimeTypeResolver
mimeChecker
;
@Scope
([
'user'
])
@Scope
([
'user'
])
@Operation
.
get
()
@Operation
.
get
()
Future
<
Response
>
getFiles
()
async
{
Future
<
Response
>
getFiles
()
async
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment