From 837396ca2889b9e4e4a7b33a31409a2cd12a483c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 8 Dec 2009 18:06:16 -0800 Subject: 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) --- modules/rest/helpers/rest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/rest/helpers') 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) { -- cgit v1.2.3