We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
on_interim_response
1 parent 899c690 commit a423d5eCopy full SHA for a423d5e
1 file changed
lib/protocol/http/request.rb
@@ -74,6 +74,17 @@ def send_interim_response(status, headers)
74
@interim_response&.call(status, headers)
75
end
76
77
+ def on_interim_response(&block)
78
+ if interim_response = @interim_response
79
+ @interim_response = ->(status, headers) do
80
+ block.call(status, headers)
81
+ interim_response.call(status, headers)
82
+ end
83
+ else
84
+ @interim_response = block
85
86
87
+
88
# Whether this is a HEAD request: no body is expected in the response.
89
def head?
90
@method == Methods::HEAD
0 commit comments