diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-08 18:06:16 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-08 18:06:16 -0800 |
commit | 837396ca2889b9e4e4a7b33a31409a2cd12a483c (patch) | |
tree | faf5f67d49ea2bea2fa13aae0b2731d56cb1b7a0 /modules/rest/helpers | |
parent | 6fd04069aec67ff115cac4296c013cb5eea6782b (diff) |
Change the url mapping so that path to the is part of the url
The request key is put in the X-Gallery-Request-Key header
The HTTP method can be override by using the X-Gallery-Request-Method header
Normalize the request data so that it doesn't matter where it comes from (HTTP get or HTTP post request)
Diffstat (limited to 'modules/rest/helpers')
-rw-r--r-- | modules/rest/helpers/rest.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/rest/helpers/rest.php b/modules/rest/helpers/rest.php index 64a32d40..22c13be9 100644 --- a/modules/rest/helpers/rest.php +++ b/modules/rest/helpers/rest.php @@ -60,9 +60,12 @@ class rest_Core { if (!empty($message)) { $response["message"] = (string)$message; } + if ($response_data) { + $response = array_merge($response, $response_data); + } // We don't need to save the session for this request Session::abort_save(); - return json_encode(array_merge($response, $response_data)); + return json_encode($response); } private static function _format_response($message, $log_message) { |