Commit 02838458 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Wenn der PictureProxy ein Bild nicht abrufen kann, wirft er keinen Error mehr

parent 11650492
......@@ -17,6 +17,7 @@ class Pictureproxy extends Controller
function get(Request $request) {
if( $request->has('url') )
{
try{
$file = file_get_contents($request->input('url'));
$responseCode = explode(" ", $http_response_header[0])[1];
$contentType = "";
......@@ -30,6 +31,10 @@ class Pictureproxy extends Controller
}
$response = Response::make($file, $responseCode);
$response->header('Content-Type', $contentType);
}catch(\ErrorException $e)
{
$response = Response::make("", 404);
}
return $response;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment