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

Fixed an error where a Location header redirect was not properly detected

parent 7bf42113
No related branches found
No related tags found
1 merge request!14Resolve "Proxy responds with " Whoops, looks like something went wrong.""
...@@ -330,10 +330,15 @@ class ProxyController extends Controller ...@@ -330,10 +330,15 @@ class ProxyController extends Controller
$headerArray[strtolower(trim($ar[0]))] = strtolower(trim($ar[1])); $headerArray[strtolower(trim($ar[0]))] = strtolower(trim($ar[1]));
} elseif (strtolower($ar[0]) === "location") { } elseif (strtolower($ar[0]) === "location") {
$redLink = $ar[1]; $redLink = $ar[1];
if (strpos($redLink, "/") === 0) { if (strpos($redLink, "/") === 0) {
$parse = parse_url($url); $parse = parse_url($url);
$redLink = $parse["scheme"] . "://" . $parse["host"] . $redLink; $redLink = $parse["scheme"] . "://" . $parse["host"] . $redLink;
} else if (preg_match("/\w+\.\w+/si", $redLink)) {
$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, false);
} elseif (strtolower($ar[0]) === "content-disposition") { } elseif (strtolower($ar[0]) === "content-disposition") {
$headerArray[strtolower(trim($ar[0]))] = strtolower(trim($ar[1])); $headerArray[strtolower(trim($ar[0]))] = strtolower(trim($ar[1]));
......
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