Commit 192dba47 authored by Dominik Hebeler's avatar Dominik Hebeler

Aded streamed download with correct content type header

parent 6d375506
......@@ -222,10 +222,38 @@ Route::group(
->with('navbarFocus', 'dienste');
});
Route::get('metager', function () {
return redirect("https://gitlab.metager.de/open-source/app-en/raw/latest/app/release/app-release.apk?inline=false");
return response()->streamDownload(function () {
$fh = null;
try{
$fh = fopen("https://gitlab.metager.de/open-source/app-en/raw/latest/app/release/app-release.apk?inline=false", "r")
while (!feof($handle)) {
echo(fread($handle, 1024));
}
}catch(\Exception $e){
abort(404);
}finally {
if($fh != null){
fclose($fh);
}
}
}, 'MetaGerSearch.apk', ["Content-Type" => "application/vnd.android.package-archive"]);
});
Route::get('maps', function () {
return redirect("https://gitlab.metager.de/open-source/metager-maps-android/raw/latest/app/release/app-release.apk?inline=false");
return response()->streamDownload(function () {
$fh = null;
try{
$fh = fopen("https://gitlab.metager.de/open-source/metager-maps-android/raw/latest/app/release/app-release.apk?inline=false", "r")
while (!feof($handle)) {
echo(fread($handle, 1024));
}
}catch(\Exception $e){
abort(404);
}finally {
if($fh != null){
fclose($fh);
}
}
}, 'MetaGerMaps.apk', ["Content-Type" => "application/vnd.android.package-archive"]);
});
Route::get('maps/version', function () {
......
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