Skip to content
Snippets Groups Projects
Commit 0551c9e7 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

proper answer for javascript mime type

parent 0698398f
No related branches found
No related tags found
No related merge requests found
......@@ -208,10 +208,12 @@ class ProxyController extends Controller
]), 413);
} else if ($answer["error"] === CURLE_COULDNT_RESOLVE_HOST) {
return view('curl_errors.6', ["answer" => $answer]);
} else {
Log::info("No view for this error. " . json_encode($answer));
}
}
if ($answer === null) {
if ($answer === null || !array_key_exists("http-code", $answer)) {
abort(400, "Couldn't fetch response", [
"url" => $targetUrl
]);
......@@ -286,6 +288,10 @@ class ProxyController extends Controller
\App\PrometheusExporter::registerProxyPageCall("pdf");
break;
// no break
case 'application/javascript':
abort(415);
case 'application/xml':
break;
case 'image/png':
case 'image/jpeg':
case 'image/gif':
......@@ -295,7 +301,8 @@ class ProxyController extends Controller
\App\PrometheusExporter::registerProxyPageCall("image");
break;
case 'video/mp4':
\App\PrometheusExporter::registerProxyPageCall("image");
case 'video/webm':
\App\PrometheusExporter::registerProxyPageCall("video");
break;
case 'application/font-woff':
case 'application/x-font-woff':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment