TT#68300 Simplify the result method implementation

Change-Id: Ia4bab392c231a7dabb08ce8715424d191f385cf7
changes/12/34112/5
Guillem Jover 6 years ago
parent b6f3438e9a
commit 83f596c22a

@ -217,10 +217,14 @@ sub as_hash {
sub result { sub result {
my $self = shift; my $self = shift;
my $location = $self->headers->header('Location') || ''; my $content;
return $self->is_success if ($self->is_success) {
? sprintf "%s %s", $self->status_line, $location $content = $self->headers->header('Location') // '';
: sprintf "%s %s", $self->status_line, $self->content; } else {
$content = $self->content;
}
return sprintf "%s %s", $self->status_line, $content;
} }
1; 1;

Loading…
Cancel
Save