Skip to content

Commit d4a4348

Browse files
ixtisavonarola
andcommitted
chore: Improve implicit Content-Length failures
Suggest setting `Content-Length` header manually in case we can't guess body size. See-Also: #560 Co-Authored-By: @savonarola <[email protected]>
1 parent 297d303 commit d4a4348

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/http/request/body.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def size
2424
elsif @source.nil?
2525
0
2626
else
27-
raise RequestError, "cannot determine size of body: #{@source.inspect}"
27+
raise RequestError, "cannot determine size of body: #{@source.inspect}, " \
28+
"please set 'Content-Length' header explicitly"
2829
end
2930
end
3031

0 commit comments

Comments
 (0)