diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-07-05 20:43:18 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-07-07 00:19:20 +0200 |
commit | 37722eca39874bb6abdcd120e3e458bd62dea62b (patch) | |
tree | 57a9a9970c00ec77baecab7e154ef7dfcef863fe /Bugzilla/WebService/Server | |
parent | a6f98de0d4e842351222b0173a1fff151da8738e (diff) | |
download | bugzilla-37722eca39874bb6abdcd120e3e458bd62dea62b.tar.gz bugzilla-37722eca39874bb6abdcd120e3e458bd62dea62b.tar.xz |
Bug 1377933 - Remove trailing whitespace from all perl files
Diffstat (limited to 'Bugzilla/WebService/Server')
-rw-r--r-- | Bugzilla/WebService/Server/JSONRPC.pm | 28 | ||||
-rw-r--r-- | Bugzilla/WebService/Server/REST/Resources/Group.pm | 2 | ||||
-rw-r--r-- | Bugzilla/WebService/Server/XMLRPC.pm | 18 |
3 files changed, 24 insertions, 24 deletions
diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 24ad12730..0fb8b4299 100644 --- a/Bugzilla/WebService/Server/JSONRPC.pm +++ b/Bugzilla/WebService/Server/JSONRPC.pm @@ -167,8 +167,8 @@ sub retrieve_json_from_get { my $params; if (defined $cgi->param('params')) { local $@; - $params = eval { - $self->json->decode(scalar $cgi->param('params')) + $params = eval { + $self->json->decode(scalar $cgi->param('params')) }; if ($@) { ThrowUserError('json_rpc_invalid_params', @@ -195,12 +195,12 @@ sub retrieve_json_from_get { sub type { my ($self, $type, $value) = @_; - + # This is the only type that does something special with undef. if ($type eq 'boolean') { return $value ? JSON::true : JSON::false; } - + return JSON::null if !defined $value; my $retval = $value; @@ -363,7 +363,7 @@ sub _argument_type_check { if (defined $params->{$field}) { my $value = $params->{$field}; if (ref $value eq 'ARRAY') { - $params->{$field} = + $params->{$field} = [ map { $self->datetime_format_inbound($_) } @$value ]; } else { @@ -401,7 +401,7 @@ sub _argument_type_check { # methods that can change data. This protects us against cross-site # request forgeries. if (!grep($_ eq $method, $pkg->READ_ONLY)) { - ThrowUserError('json_rpc_post_only', + ThrowUserError('json_rpc_post_only', { method => $self->_bz_method_name }); } } @@ -415,7 +415,7 @@ sub _argument_type_check { $self->handle_login(); # Bugzilla::WebService packages call internal methods like - # $self->_some_private_method. So we have to inherit from + # $self->_some_private_method. So we have to inherit from # that class as well as this Server class. my $new_class = ref($self) . '::' . $pkg; my $isa_string = 'our @ISA = qw(' . ref($self) . " $pkg)"; @@ -435,7 +435,7 @@ sub _argument_type_check { # _bz_method_name is stored by _find_procedure for later use. sub _bz_method_name { - return $_[0]->{_bz_method_name}; + return $_[0]->{_bz_method_name}; } sub _bz_callback { @@ -502,7 +502,7 @@ L<Bugzilla::WebService/LOGGING IN>. To connect over GET, simply send the values that you'd normally send for each JSON-RPC argument as URL parameters, with the C<params> item being -a JSON string. +a JSON string. The simplest example is a call to C<Bugzilla.time>: @@ -531,10 +531,10 @@ L<http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/>. To use JSONP with Bugzilla's JSON-RPC WebService, simply specify a C<callback> parameter to jsonrpc.cgi when using it via GET as described above. -For example, here's some HTML you could use to get the data from +For example, here's some HTML you could use to get the data from C<Bugzilla.time> on a remote website, using JSONP: - <script type="text/javascript" + <script type="text/javascript" src="http://bugzilla.example.com/jsonrpc.cgi?method=Bugzilla.time&callback=foo"> That would call the C<Bugzilla.time> method and pass its value to a function @@ -591,9 +591,9 @@ throw an error. In Bugzilla, the error contents look like: So, for example, in JSON-RPC 1.0, an error response would look like: - { - result: null, - error: { message: 'Some message here', code: 123 }, + { + result: null, + error: { message: 'Some message here', code: 123 }, id: 1 } diff --git a/Bugzilla/WebService/Server/REST/Resources/Group.pm b/Bugzilla/WebService/Server/REST/Resources/Group.pm index e61408753..6e3d934eb 100644 --- a/Bugzilla/WebService/Server/REST/Resources/Group.pm +++ b/Bugzilla/WebService/Server/REST/Resources/Group.pm @@ -55,7 +55,7 @@ __END__ =head1 NAME -Bugzilla::Webservice::Server::REST::Resources::Group - The REST API for +Bugzilla::Webservice::Server::REST::Resources::Group - The REST API for creating, changing, and getting information about Groups. =head1 DESCRIPTION diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index f8b7e0994..f5a31b30e 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -175,23 +175,23 @@ sub decode_value { my $self = shift; my ($type) = @{ $_[0] }; my $value = $self->SUPER::decode_value(@_); - + # We only validate/convert certain types here. return $value if $type !~ /^(?:int|i4|boolean|double|dateTime\.iso8601)$/; - + # Though the XML-RPC standard doesn't allow an empty <int>, # <double>,or <dateTime.iso8601>, we do, and we just say # "that's undef". if (grep($type eq $_, qw(int double dateTime))) { return undef if $value eq ''; } - + my $validator = $self->_validation_subs->{$type}; if (!$validator->($value)) { ThrowUserError('xmlrpc_invalid_value', { type => $type, value => $value }); } - + # We convert dateTimes to a DB-friendly date format. if ($type eq 'dateTime.iso8601') { if ($value !~ /T.*[\-+Z]/i) { @@ -211,7 +211,7 @@ sub _validation_subs { # The only place that XMLRPC::Lite stores any sort of validation # regex is in XMLRPC::Serializer. We want to re-use those regexes here. my $lookup = Bugzilla::XMLRPC::Serializer->new->typelookup; - + # $lookup is a hash whose values are arrayrefs, and whose keys are the # names of types. The second item of each arrayref is a subroutine # that will do our validation for us. @@ -222,7 +222,7 @@ sub _validation_subs { # XMLRPC::Serializer than their standard XML-RPC name. $validators{'dateTime.iso8601'} = $validators{'dateTime'}; $validators{'i4'} = $validators{'int'}; - + $self->{_validation_subs} = \%validators; return \%validators; } @@ -238,7 +238,7 @@ use Bugzilla::WebService::Util qw(taint_data); sub paramsin { my $self = shift; if (!$self->{bz_params_in}) { - my @params = $self->SUPER::paramsin(@_); + my @params = $self->SUPER::paramsin(@_); if ($self->{_bz_do_taint}) { taint_data(@params); } @@ -341,7 +341,7 @@ sub BEGIN { return as_nil(); } else { - my $super_method = "SUPER::$method"; + my $super_method = "SUPER::$method"; return $self->$super_method($value); } } @@ -415,7 +415,7 @@ is always considered to be C<undef>, no matter what it contains. Bugzilla does not use C<< <nil> >> values in returned data, because currently most clients do not support C<< <nil> >>. Instead, any fields with C<undef> values will be stripped from the response completely. Therefore -B<the client must handle the fact that some expected fields may not be +B<the client must handle the fact that some expected fields may not be returned>. =begin private |