Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dont overwrite content-length if its already set, closes #176

  • Loading branch information...
commit a28801bff151ea813f9bb521716d50017002909e 1 parent e7beb1b
@igrigorik authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/em-http/client.rb
View
4 lib/em-http/client.rb
@@ -172,10 +172,10 @@ def send_request(head, body)
# Set the Content-Length if body is given,
# or we're doing an empty post or put
if body
- head['content-length'] = body.bytesize
+ head['content-length'] = body.bytesize
elsif @req.method == 'POST' or @req.method == 'PUT'
# wont happen if body is set and we already set content-length above
- head['content-length'] = 0
+ head['content-length'] ||= 0
end
# Set content-type header if missing and body is a Ruby hash
Please sign in to comment.
Something went wrong with that request. Please try again.