Created
January 10, 2019 09:17
-
-
Save mensfeld/94e3178175e37cd75c07ea62f75140bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NetHttpFaradayPatch | |
def create_request(env) | |
super.tap do |request| | |
if env[:body].respond_to?(:read) | |
request.content_length = env[:body].size | |
end | |
end | |
end | |
end | |
Faraday::Adapter::NetHttp.prepend(NetHttpFaradayPatch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment