Skip to content

Commit 4dcc0db

Browse files
committed
fix: force_encoding for file data
1 parent 48b4171 commit 4dcc0db

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/httparty/request/body.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def normalize_query(query)
8383
def content_body(object)
8484
if file?(object)
8585
object = (file = object).read
86+
object.force_encoding(Encoding::UTF_8) if object.respond_to?(:force_encoding)
8687
file.rewind if file.respond_to?(:rewind)
8788
end
8889

0 commit comments

Comments
 (0)