Skip to content

Commit

Permalink
use a little less code to build HTTP headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 26, 2016
1 parent 99801d0 commit 6baac01
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Mojo/Transaction/HTTP.pm
Expand Up @@ -93,16 +93,13 @@ sub _headers {

# Switch to body
if ($self->{write} <= 0) {
$self->{offset} = 0;
@$self{qw(http_state offset)} = ('body', 0);

# Response without body
if ($head && $self->is_empty) { $self->completed }

# Body
else {
$self->{http_state} = 'body';
$self->{write} = $msg->content->is_dynamic ? 1 : $msg->body_size;
}
else { $self->{write} = $msg->content->is_dynamic ? 1 : $msg->body_size }
}

return $buffer;
Expand Down

0 comments on commit 6baac01

Please sign in to comment.