Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2022-11-08 15:44:57 +01:00
15 changed files with 142 additions and 27 deletions

View File

@@ -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)