Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Kurz <[email protected]>
  • Loading branch information
josegomezr and okurz authored Nov 16, 2023
1 parent c0ad220 commit b954c63
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions t/ui/27-plugin_obs_rsync_obs_status.t
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,15 @@ my $server_process = sub {
my $www_authenticate = qq(Signature realm="Use your developer account",headers="(created)"); # uncoverable statement
$mock->routes->get(
'/build/ProjWithAuth/_result' => sub ($c) {
if ($c->req->headers->authorization) {
return $c->render(status => 200, text => $fake_response_by_project{Proj1});
}
return $c->render(status => 200, text => $fake_response_by_project{Proj1}) if $c->req->headers->authorization;
$c->res->headers->www_authenticate($www_authenticate);
return $c->render(status => 401, text => 'login');
});

$mock->routes->get(
'/build/ProjTestingSignature/_result' => sub ($c) {
my $client_auth_header = $c->req->headers->authorization // '';
if ($auth_header_exact eq $client_auth_header) {
return $c->render(status => 200, text => $fake_response_by_project{Proj1});
}
return $c->render(status => 200, text => $fake_response_by_project{Proj1}) if $auth_header_exact eq $client_auth_header;
$c->res->headers->www_authenticate($www_authenticate);
return $c->render(status => 401, text => 'login');
});
Expand Down

0 comments on commit b954c63

Please sign in to comment.