File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ defmodule Waffle.File do
173
173
174
174
# hackney :connect_timeout - timeout used when establishing a connection, in milliseconds
175
175
# hackney :recv_timeout - timeout used when receiving from a connection, in milliseconds
176
+ # hackney :max_body_length - maximum size of the file to download, in bytes. Defaults to :infinity
176
177
# :backoff_max - maximum backoff time, in milliseconds
177
178
# :backoff_factor - a backoff factor to apply between attempts, in milliseconds
178
179
defp get_remote_path ( remote_path , definition ) do
@@ -214,7 +215,9 @@ defmodule Waffle.File do
214
215
end
215
216
216
217
defp body ( client_ref , response_headers ) do
217
- case :hackney . body ( client_ref ) do
218
+ max_body_length = Application . get_env ( :waffle , :max_body_length , :infinity )
219
+
220
+ case :hackney . body ( client_ref , max_body_length ) do
218
221
{ :ok , body } ->
219
222
response_headers = :hackney_headers . new ( response_headers )
220
223
filename = content_disposition ( response_headers )
You can’t perform that action at this time.
0 commit comments