diff --git a/ocs/v1.php b/ocs/v1.php
index af83a56ff147715f7ebd1378ade420ccee4b60f2..1c7d1c8976824efe44dea0abe24a9f041b7df201 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -26,7 +26,7 @@ use Symfony\Component\Routing\Exception\ResourceNotFoundException;
 use Symfony\Component\Routing\Exception\MethodNotAllowedException;
 
 try {
-	OC::getRouter()->match('/ocs'.$_SERVER['PATH_INFO']);
+	OC::getRouter()->match('/ocs'.OC_Request::getRawPathInfo());
 } catch (ResourceNotFoundException $e) {
 	OC_OCS::notFound();
 } catch (MethodNotAllowedException $e) {