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 {
my $self = shift;
my $location = $self->headers->header('Location') || '';
return $self->is_success
? sprintf "%s %s", $self->status_line, $location
: sprintf "%s %s", $self->status_line, $self->content;
my $content;
if ($self->is_success) {
$content = $self->headers->header('Location') // '';
} else {
$content = $self->content;
}
return sprintf "%s %s", $self->status_line, $content;
}
1;

Loading…
Cancel
Save