Skip to content

Commit

Permalink
Lift sending header out of the case block
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
  • Loading branch information
Sam Phippen committed Sep 5, 2012
1 parent e5b3a9a commit 2850e60
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/http/request_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ def stream
self.add_headers
self.add_body_type_headers

@socket << @request_header
case @body
when NilClass
@socket << @request_header
when String
@socket << @request_header
@socket << @body
when Enumerable
@socket << @request_header
@body.each do |chunk|
@socket << chunk.bytesize.to_s(16) << CRLF
@socket << chunk
Expand Down

0 comments on commit 2850e60

Please sign in to comment.