Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pasteque
pasteque-server
Commits
72af3eaa
Commit
72af3eaa
authored
Mar 24, 2020
by
Karamel
Browse files
Send 404 response when no image is set in GET api/image/{model}/{id}.
parent
ae166681
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/http/routes/image.php
View file @
72af3eaa
...
...
@@ -37,6 +37,10 @@ $app->GET('/api/image/{model}/{id}', function($request, $response, $args) {
[[
'model'
=>
$args
[
'model'
],
'modelId'
=>
$args
[
'id'
]]]);
if
(
$imgCall
->
getStatus
()
==
APIResult
::
STATUS_CALL_OK
)
{
$img
=
$imgCall
->
getContent
();
if
(
$img
===
null
)
{
$response
->
withStatus
(
404
,
"Image not found"
);
return
$response
;
}
$mime
=
$img
->
getMimeType
();
$data
=
$img
->
getImage
();
$response
=
$response
->
withStatus
(
200
);
...
...
Write
Preview
Markdown
is supported
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