DEV: Don't mutate Excon.defaults[:middlewares] (#16151)

`Excon.defaults` and its middlewares array are constants that we
shouldn't mutate everytime `FinalDestination#resolve` is called.
This commit is contained in:
Osama Sayegh 2022-03-10 14:21:45 +03:00 committed by GitHub
parent 892f7e0506
commit 9b5cc1424f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,7 +202,7 @@ class FinalDestination
end
headers = request_headers
middlewares = Excon.defaults[:middlewares]
middlewares = Excon.defaults[:middlewares].dup
middlewares << Excon::Middleware::Decompress if @http_verb == :get
request_start_time = Time.now