diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-11-08 16:42:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-08 16:42:24 +0100 |
commit | b2a25d446a9f4368ad9d1240b9da30bc33942da5 (patch) | |
tree | 886b0986c3bbf57bf2767aa5300aabf4f020a277 /app/lib | |
parent | ac219dd1f6d660d3728c5881c4eb3b672fea432e (diff) | |
parent | 9b6d6a919f3bd908fbdf3efc9aa5d97d33e3fe6e (diff) |
Merge pull request #1905 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/request.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/lib/request.rb b/app/lib/request.rb index 648aa3085..1ea86862d 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -62,8 +62,6 @@ class Request end begin - response = response.extend(ClientLimit) - # If we are using a persistent connection, we have to # read every response to be able to move forward at all. # However, simply calling #to_s or #flush may not be safe, @@ -181,6 +179,14 @@ class Request end end + if ::HTTP::Response.methods.include?(:body_with_limit) && !Rails.env.production? + abort 'HTTP::Response#body_with_limit is already defined, the monkey patch will not be applied' + else + class ::HTTP::Response + include Request::ClientLimit + end + end + class Socket < TCPSocket class << self def open(host, *args) |