Permalink
Browse files

send Content-Length header

Change-Id: I9beed314633003c268f42032af46563ff4e48091
  • Loading branch information...
vito committed Dec 19, 2011
1 parent bd04181 commit c93b713273e9a1f12d25fe74f940778e25398284
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/caldecott/client/http_tunnel.rb
@@ -75,7 +75,7 @@ def start(base_uri, init_msg)
parsed_uri.path = '/tunnels'
@log.debug "post #{parsed_uri.to_s}"
- req = EM::HttpRequest.new(parsed_uri.to_s).post :body => init_msg, :head => { "Auth-Token" => @auth_token }
+ req = EM::HttpRequest.new(parsed_uri.to_s).post :body => init_msg, :head => { "Auth-Token" => @auth_token, "Content-Length" => init_msg.bytesize }
req.callback do
@log.debug "post #{parsed_uri.to_s} #{req.response_header.status}"
@@ -210,7 +210,7 @@ def send_data_buffered
uri = "#{@uri}/#{@seq}"
@log.debug "put #{uri}"
- req = EM::HttpRequest.new(uri).put :body => data, :head => { "Auth-Token" => @auth_token }
+ req = EM::HttpRequest.new(uri).put :body => data, :head => { "Auth-Token" => @auth_token, "Content-Length" => data.bytesize }
req.errback do
@log.debug "put #{uri} error"

0 comments on commit c93b713

Please sign in to comment.