From 1763de08d0a4e8374cd21bf71d825b92426509f1 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Sat, 11 Aug 2012 00:57:46 +0200
Subject: [PATCH] Routing: Fix construction of RequestContext

---
 lib/router.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/router.php b/lib/router.php
index dbcaff4026..eca59d6dc3 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -54,7 +54,11 @@ class OC_Router {
 	}
 
     	public function match($url) {
-		$context = new RequestContext($_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD']);
+		$baseUrl = OC_Helper::linkTo('', 'index.php');
+		$method = $_SERVER['REQUEST_METHOD'];
+		$host = OC_Request::serverHost();
+		$schema = OC_Request::serverProtocol();
+		$context = new RequestContext($baseUrl, $method, $host, $schema);
 		$matcher = new UrlMatcher($this->root, $context);
 		$parameters = $matcher->match($url);
 		if (isset($parameters['action'])) {
-- 
GitLab