summaryrefslogtreecommitdiff
path: root/modules/rest/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-08 18:06:16 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-08 18:06:16 -0800
commit837396ca2889b9e4e4a7b33a31409a2cd12a483c (patch)
treefaf5f67d49ea2bea2fa13aae0b2731d56cb1b7a0 /modules/rest/helpers
parent6fd04069aec67ff115cac4296c013cb5eea6782b (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.php5
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) {