Skip to content

Commit

Permalink
chore: Improve implicit Content-Length failures
Browse files Browse the repository at this point in the history
Suggest setting `Content-Length` header manually in case we can't guess
body size.

See-Also: #560
Co-Authored-By: @savonarola <ilya.averyanov@gmail.com>
  • Loading branch information
ixti and savonarola committed Sep 14, 2021
1 parent 297d303 commit d4a4348
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/http/request/body.rb
Expand Up @@ -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

Expand Down

0 comments on commit d4a4348

Please sign in to comment.