From d4a4348f7fdc589760ec032d66515bb967b3a4a2 Mon Sep 17 00:00:00 2001 From: Alexey Zapparov Date: Tue, 14 Sep 2021 16:37:45 +0200 Subject: [PATCH] chore: Improve implicit Content-Length failures Suggest setting `Content-Length` header manually in case we can't guess body size. See-Also: https://github.com/httprb/http/pull/560 Co-Authored-By: @savonarola --- lib/http/request/body.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http/request/body.rb b/lib/http/request/body.rb index 14af30b8..46ce4f24 100644 --- a/lib/http/request/body.rb +++ b/lib/http/request/body.rb @@ -24,7 +24,8 @@ def size elsif @source.nil? 0 else - raise RequestError, "cannot determine size of body: #{@source.inspect}" + raise RequestError, "cannot determine size of body: #{@source.inspect}, " \ + "please set 'Content-Length' header explicitly" end end