mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 17:27:57 +00:00
Fix Client to expect X-Percona-Resource-Type else links. Add headers to Mock/UserAgent. Start testing run_agent(). As TO_JSON() magic to Run so encode can encode Service contain blessed Run objs. Use BUILDARGS to convert Run as hashref to real objs.
This commit is contained in:
@@ -44,12 +44,14 @@ sub request {
|
||||
if ( $type eq 'post' || $type eq 'put' ) {
|
||||
$self->{content}->{$type} = $req->content;
|
||||
}
|
||||
my $r = shift @{$self->{responses}->{$type}};
|
||||
my $c = $self->{encode}->($r->{content});
|
||||
my $r = shift @{$self->{responses}->{$type}};
|
||||
my $c = $self->{encode}->($r->{content});
|
||||
my $h = HTTP::Headers->new;
|
||||
$h->header(%{$r->{headers}}) if exists $r->{headers};
|
||||
my $res = HTTP::Response->new(
|
||||
$r->{code} || 200,
|
||||
'',
|
||||
HTTP::Headers->new,
|
||||
$h,
|
||||
$c,
|
||||
);
|
||||
return $res;
|
||||
|
Reference in New Issue
Block a user