From aa44b8773c3b926dd5f3499438b286f51348d61a Mon Sep 17 00:00:00 2001 From: martin sarsale Date: Mon, 26 Dec 2011 19:23:42 -0200 Subject: [PATCH] The Content-Length header should be the size in bytes From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET. --- lib/savon/soap/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/savon/soap/request.rb b/lib/savon/soap/request.rb index 3cecef8c..b8905bc3 100644 --- a/lib/savon/soap/request.rb +++ b/lib/savon/soap/request.rb @@ -40,7 +40,7 @@ def configure(http) http.url = soap.endpoint http.body = soap.to_xml http.headers["Content-Type"] = ContentType[soap.version] - http.headers["Content-Length"] = soap.to_xml.length.to_s + http.headers["Content-Length"] = soap.to_xml.bytesize.to_s http end