diff --git a/lib/private/appframework/app.php b/lib/private/appframework/app.php
index b94c7bd9957926bff9bc877f241fa02e8dcaf002..537f10255a37864f3ff9f8a81de42085a1e79237 100644
--- a/lib/private/appframework/app.php
+++ b/lib/private/appframework/app.php
@@ -75,7 +75,9 @@ class App {
 	 */
 	public static function main($controllerName, $methodName, DIContainer $container, array $urlParams = null) {
 		if (!is_null($urlParams)) {
-			$container['urlParams'] = $urlParams;
+			$container['OCP\\IRequest']->setUrlParameters($urlParams);
+		} else if (isset($container['urlParams']) && !is_null($container['urlParams'])) {
+			$container['OCP\\IRequest']->setUrlParameters($container['urlParams']);
 		}
 		$appName = $container['AppName'];
 
diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php
index f6a0c0c49747eb63c291aceee38b833e52bd0c9a..dc80d88a8807a0c9280338d433778d461c35db7d 100644
--- a/lib/private/appframework/dependencyinjection/dicontainer.php
+++ b/lib/private/appframework/dependencyinjection/dicontainer.php
@@ -233,7 +233,6 @@ class DIContainer extends SimpleContainer implements IAppContainer {
 			/** @var $c SimpleContainer */
 			/** @var $server SimpleContainer */
 			$server = $c->query('ServerContainer');
-			$server->registerParameter('urlParams', $c['urlParams']);
 			/** @var $server IServerContainer */
 			return $server->getRequest();
 		});
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php
index 350694dca815995e6a7f06ca6d66f38d52abb47d..6012033fe52f5e21a771aca8217cbf4ab44a8bbe 100644
--- a/lib/private/appframework/http/request.php
+++ b/lib/private/appframework/http/request.php
@@ -68,12 +68,12 @@ class Request implements \ArrayAccess, \Countable, IRequest {
 		$this->items['params'] = array();
 
 		if(!array_key_exists('method', $vars)) {
-			$vars['method'] = 'GET';			
+			$vars['method'] = 'GET';
 		}
 
 		foreach($this->allowedKeys as $name) {
 			$this->items[$name] = isset($vars[$name])
-				? $vars[$name] 
+				? $vars[$name]
 				: array();
 		}
 
@@ -83,7 +83,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
 			if(count($params) > 0) {
 				$this->items['params'] = $params;
 				if($vars['method'] === 'POST') {
-					$this->items['post'] = $params;					
+					$this->items['post'] = $params;
 				}
 			}
 		// Handle application/x-www-form-urlencoded for methods other than GET
@@ -91,12 +91,12 @@ class Request implements \ArrayAccess, \Countable, IRequest {
 		} elseif($vars['method'] !== 'GET'
 				&& $vars['method'] !== 'POST'
 				&& strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') !== false) {
-			
+
 			parse_str(file_get_contents($this->inputStream), $params);
 			if(is_array($params)) {
 				$this->items['params'] = $params;
 			}
-		} 
+		}
 
 		$this->items['parameters'] = array_merge(
 			$this->items['get'],
@@ -107,6 +107,14 @@ class Request implements \ArrayAccess, \Countable, IRequest {
 
 	}
 
+	public function setUrlParameters($parameters) {
+		$this->items['urlParams'] = $parameters;
+		$this->items['parameters'] = array_merge(
+			$this->items['parameters'],
+			$this->items['urlParams']
+		);
+	}
+
 	// Countable method.
 	public function count() {
 		return count(array_keys($this->items['parameters']));
@@ -207,8 +215,8 @@ class Request implements \ArrayAccess, \Countable, IRequest {
 				return $this->items['method'];
 				break;
 			default;
-				return isset($this[$name]) 
-					? $this[$name] 
+				return isset($this[$name])
+					? $this[$name]
 					: null;
 				break;
 		}
diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php
index caa22c84415ee26342569f4ce216e4993c019b39..85db76efe719fd39ae5b0f63d96482774ccb0f30 100644
--- a/tests/lib/appframework/http/RequestTest.php
+++ b/tests/lib/appframework/http/RequestTest.php
@@ -214,4 +214,21 @@ class RequestTest extends \Test\TestCase {
 		$this->fail('Expected LogicException.');
 
 	}
+
+
+	public function testSetUrlParameters() {
+		$vars = array(
+			'post' => array(),
+			'method' => 'POST',
+			'urlParams' => array('id' => '2'),
+		);
+
+		$request = new Request($vars, $this->stream);
+
+		$newParams = array('id' => '3', 'test' => 'test2');
+		$request->setUrlParameters($newParams);
+		$this->assertEquals('test2', $request->getParam('test'));
+		$this->assertEquals('3', $request->getParam('id'));
+		$this->assertEquals('3', $request->getParams()['id']);
+	}
 }