Permalink
Browse files

If the access token is not set, then look in the post data.

  • Loading branch information...
1 parent 846a835 commit 7b35091b47f0b1ed2677795885553c07fd7bf168 @talmdal talmdal committed Mar 22, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 modules/rest/controllers/rest.php
@@ -41,6 +41,7 @@ public function index() {
public function __call($function, $args) {
$input = Input::instance();
$request = new stdClass();
+
switch ($method = strtolower($input->server("REQUEST_METHOD"))) {
case "get":
$request->params = (object) $input->get();
@@ -56,6 +57,11 @@ public function __call($function, $args) {
$request->method = strtolower($input->server("HTTP_X_GALLERY_REQUEST_METHOD", $method));
$request->access_token = $input->server("HTTP_X_GALLERY_REQUEST_KEY");
+
+ if (empty($request->access_token) && !empty($request->params->access_token)) {
+ $request->access_token = $request->params->access_token;
+ }
+
$request->url = url::abs_current(true);
rest::set_active_user($request->access_token);

0 comments on commit 7b35091

Please sign in to comment.