diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index 01de00c534acaf4031b1522abed53909ab925f11..33470a77d27b822dd543f3c8d77ea8d9f4e4e832 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -129,7 +129,7 @@ class Module
             $request = Request::createFromGlobals();
         }
 
-        if ($request->getPathInfo() === '/') {
+        if ($request->server->get('PATH_INFO') === '/') {
             throw new Error\NotFound('No PATH_INFO to module.php');
         }
 
@@ -566,7 +566,7 @@ class Module
      */
     public static function removeTrailingSlash(Request $request)
     {
-        $pathInfo = $request->getPathInfo();
+        $pathInfo = $request->server->get('PATH_INFO');
         $url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $request->getRequestUri());
         return new RedirectResponse($url, 308);
     }