summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Server/REST.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-08-21 22:00:49 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-08-21 22:00:49 +0200
commit555d1863255a66e5b98e2f5295e6ea25dcd2f1bf (patch)
tree74b676b30572dfc294f4d5410781faf623c7c8a6 /Bugzilla/WebService/Server/REST.pm
parent83cdb54793a58b9bc1e66d38437f777a36bddfb9 (diff)
downloadbugzilla-555d1863255a66e5b98e2f5295e6ea25dcd2f1bf.tar.gz
bugzilla-555d1863255a66e5b98e2f5295e6ea25dcd2f1bf.tar.xz
Bug 907245 - Allow for URL params to also be passed with POST/PUT REST API requests
Diffstat (limited to 'Bugzilla/WebService/Server/REST.pm')
-rw-r--r--Bugzilla/WebService/Server/REST.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Server/REST.pm b/Bugzilla/WebService/Server/REST.pm
index 8d3aa481c..454749b5d 100644
--- a/Bugzilla/WebService/Server/REST.pm
+++ b/Bugzilla/WebService/Server/REST.pm
@@ -341,6 +341,14 @@ sub _retrieve_json_params {
ThrowUserError('json_rpc_invalid_params', { err_msg => $@ });
}
}
+
+ # Allow parameters in the query string if request was not GET.
+ # Note: query string parameters will override any matching params
+ # also specified in the request body.
+ foreach my $param ($self->cgi->url_param()) {
+ $extra_params->{$param} = $self->cgi->url_param($param);
+ }
+
%{$params} = (%{$params}, %{$extra_params}) if %{$extra_params};
}
@@ -527,6 +535,9 @@ tells it how you want your data back. "Content-Type" must be "application/json".
"Accept" can be either that, or "application/javascript" for JSONP - add a "callback"
parameter to name your callback.
+Parameters may also be passed in as part of the query string for non-GET requests
+and will override any matching parameters in the request body.
+
=head1 AUTHENTICATION
Along with viewing data as an anonymous user, you may also see private information