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

fixed missing id in redirects

parent fbc298ad
No related branches found
No related tags found
No related merge requests found
......@@ -144,7 +144,12 @@ class ProxyController extends Controller
if (!Cache::has($hash) || env("CACHE_ENABLED") === false) {
// Inits the Curl connection for being able to preload multiple URLs while using a keep-alive connection
$this->initCurl();
$result = $this->getUrlContent($targetUrl, false);
$key = $request->input('id', '');
if (!preg_match("/^[a-f0-9]{32}$/", $key)) {
abort(404);
}
$result = $this->getUrlContent($targetUrl, false, $key);
# $result can be null if the File Size exeeds the maximum cache size defined in .env
# In this case
......@@ -312,7 +317,7 @@ class ProxyController extends Controller
return $response;
}
private function getUrlContent($url, $withCookies)
private function getUrlContent($url, $withCookies, $key)
{
$url = htmlspecialchars_decode($url);
curl_setopt($this->ch, CURLOPT_URL, "$url");
......@@ -354,7 +359,8 @@ class ProxyController extends Controller
$parse = parse_url($url);
$redLink = $parse["scheme"] . "://" . $parse["host"] . "/" . $redLink;
}
$headerArray[trim($ar[0])] = $this->proxifyUrl($redLink, null, false);
$headerArray[trim($ar[0])] = $this->proxifyUrl($redLink, null, $key, false);
} elseif (strtolower($ar[0]) === "content-disposition") {
$headerArray[strtolower(trim($ar[0]))] = strtolower(trim($ar[1]));
} else {
......
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