diff --git a/route.php b/route.php index 82a82ee..0e39720 100644 --- a/route.php +++ b/route.php @@ -129,7 +129,8 @@ class route // Else http : keep the complete URL if ($destURL === "") throw new Exception ("Destination URL is empty", 500); - if ($destURL === $requestURL) + // Allow to redirect from POST to GET, but not GET to GET (can loop) + if ($destURL === $requestURL && $_SERVER["REQUEST_METHOD"] === "GET") throw new Exception ("Redirect to myself", 508); if (substr ($destURL, 0, strlen ($baseURL)) !== $baseURL) throw new Exception ("Can't redirect outside this site (Base $baseURL)",