Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
346ad2a5
Verified
Commit
346ad2a5
authored
6 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #7983 Mime type
parent
18fe2705
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/resource/controllers/ResController.php
+4
-1
4 additions, 1 deletion
src/app/resource/controllers/ResController.php
src/app/user/controllers/UserController.php
+4
-1
4 additions, 1 deletion
src/app/user/controllers/UserController.php
with
8 additions
and
2 deletions
src/app/resource/controllers/ResController.php
+
4
−
1
View file @
346ad2a5
...
@@ -182,9 +182,12 @@ class ResController
...
@@ -182,9 +182,12 @@ class ResController
return
$response
->
withStatus
(
404
)
->
withJson
([
'errors'
=>
'Document not found on docserver'
]);
return
$response
->
withStatus
(
404
)
->
withJson
([
'errors'
=>
'Document not found on docserver'
]);
}
}
$finfo
=
new
\finfo
(
FILEINFO_MIME_TYPE
);
$mimeType
=
$finfo
->
buffer
(
$fileContent
);
$response
->
write
(
$fileContent
);
$response
->
write
(
$fileContent
);
return
$response
->
withHeader
(
'Content-Type'
,
FILEINFO_MIME_TYPE
);
return
$response
->
withHeader
(
'Content-Type'
,
$mimeType
);
}
}
public
function
updateExternalInfos
(
Request
$request
,
Response
$response
)
public
function
updateExternalInfos
(
Request
$request
,
Response
$response
)
...
...
This diff is collapsed.
Click to expand it.
src/app/user/controllers/UserController.php
+
4
−
1
View file @
346ad2a5
...
@@ -482,9 +482,12 @@ class UserController
...
@@ -482,9 +482,12 @@ class UserController
return
$response
->
withStatus
(
404
)
->
withJson
([
'errors'
=>
'Signature not found on docserver'
]);
return
$response
->
withStatus
(
404
)
->
withJson
([
'errors'
=>
'Signature not found on docserver'
]);
}
}
$finfo
=
new
\finfo
(
FILEINFO_MIME_TYPE
);
$mimeType
=
$finfo
->
buffer
(
$image
);
$response
->
write
(
$image
);
$response
->
write
(
$image
);
return
$response
->
withHeader
(
'Content-Type'
,
FILEINFO_MIME_TYPE
);
return
$response
->
withHeader
(
'Content-Type'
,
$mimeType
);
}
}
public
function
addSignature
(
Request
$request
,
Response
$response
,
array
$aArgs
)
public
function
addSignature
(
Request
$request
,
Response
$response
,
array
$aArgs
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment