summaryrefslogtreecommitdiff
path: root/modules/rest/controllers/rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-11-22 22:01:11 -0800
committerBharat Mediratta <bharat@menalto.com>2010-11-22 22:01:11 -0800
commit554ca2e683297489251d621e2c959a6a467a6f9c (patch)
treec9e38882dcb702c9d97ba6f97efb490fcbe9a7ac /modules/rest/controllers/rest.php
parent3c523bcac6e902973c5891c02842254eaecd33a4 (diff)
Take into account the core.url_suffix configuration setting when
parsing REST urls. This fixes the problem that setting the url suffix breaks REST. Fixes #1500.
Diffstat (limited to 'modules/rest/controllers/rest.php')
-rw-r--r--modules/rest/controllers/rest.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php
index a721ff2b..c4e0fda4 100644
--- a/modules/rest/controllers/rest.php
+++ b/modules/rest/controllers/rest.php
@@ -86,6 +86,9 @@ class Rest_Controller extends Controller {
}
$request->url = url::abs_current(true);
+ if ($suffix = Kohana::config('core.url_suffix')) {
+ $request->url = substr($request->url, 0, strlen($request->url) - strlen($suffix));
+ }
rest::set_active_user($request->access_key);