]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 907245 - Allow for URL params to also be passed with POST/PUT REST API requests
authorDave Lawrence <dlawrence@mozilla.com>
Wed, 21 Aug 2013 19:59:50 +0000 (15:59 -0400)
committerDave Lawrence <dlawrence@mozilla.com>
Wed, 21 Aug 2013 19:59:50 +0000 (15:59 -0400)
r/a=glob

Bugzilla/WebService/Server/REST.pm

index 8d3aa481c62ef80f87c0b06c1e9b75174fb33aaa..454749b5d1dc897f33d679e4eba5e37f46254c78 100644 (file)
@@ -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