Skip to content

Commit

Permalink
Merge pull request #711 from AdrianGaudebert/774777-fix-post-args-in-…
Browse files Browse the repository at this point in the history
…bugs-service

Fixes bug 774777 - Fixed POST params in bugs service.
  • Loading branch information
lonnen committed Jul 18, 2012
2 parents c344c87 + 9974620 commit b4f3d3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions socorro/middleware/bugs_service.py
Expand Up @@ -25,9 +25,7 @@ def post(self, *args):
"""
Called when a POST HTTP request is executed to /bugs
"""
post_args = web.input()
query_string = "signatures/%s/" % post_args["signatures"]
params = self.parse_query_string(query_string)
params = web.input(signatures=[])
module = self.get_module(params)
impl = module.Bugs(config=self.context)
return impl.get(**params)
10 changes: 8 additions & 2 deletions webapp-php/application/models/bug.php
Expand Up @@ -87,8 +87,14 @@ public function bugsForSignatures($signatures, $bugzillaUrl)
}

$uri = Kohana::config('webserviceclient.socorro_hostname') . '/bugs/';
$data = array('signatures' => implode('+', $sigs));
$res = $this->service->post($uri, $data);
$sigs_fields = array();
foreach ($sigs as $sig) {
$sigs_fields[] = 'signatures=' . rawurlencode($sig);
}
$data = implode('&', $sigs_fields);
$this->service->post($uri, $data);
$res = $this->service->response_data;

if (!$res || !isset($res->total) || $res->total <= 0) {
return array();
}
Expand Down

0 comments on commit b4f3d3a

Please sign in to comment.