Skip to content

Commit

Permalink
Only end download on content size if Content-Length is defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
mherger committed Nov 12, 2017
1 parent c33af2c commit 572395b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Slim/Networking/Async/HTTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ sub _http_read_body {
}
}

if ( !defined $result || $result == 0 || length($self->response->content) == $self->response->headers->header('Content-Length') ) {
if ( !defined $result || $result == 0 || (defined $self->response->headers->header('Content-Length') && length($self->response->content) == $self->response->headers->header('Content-Length')) ) {
# if here, we've reached the end of the body

# close and remove the socket if not keep-alive
Expand Down

0 comments on commit 572395b

Please sign in to comment.