mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-07 00:05:02 -04:00
removing pushed request from pending to avoid race-condition on sent requests
This commit is contained in:
parent
04d96b56d2
commit
57a62fe19a
@ -44,6 +44,7 @@ module HTTPX
|
|||||||
if request
|
if request
|
||||||
request.merge_headers(headers)
|
request.merge_headers(headers)
|
||||||
@promise_headers[stream] = request
|
@promise_headers[stream] = request
|
||||||
|
parser.pending.delete(request)
|
||||||
else
|
else
|
||||||
stream.refuse
|
stream.refuse
|
||||||
end
|
end
|
||||||
|
@ -4,7 +4,7 @@ module Requests
|
|||||||
module Plugins
|
module Plugins
|
||||||
module PushPromise
|
module PushPromise
|
||||||
def test_plugin_push_promise_get
|
def test_plugin_push_promise_get
|
||||||
client = HTTPX.with(debug_level: 2, debug: $stderr).plugin(:push_promise)
|
client = HTTPX.plugin(:push_promise)
|
||||||
html, css = client.get(push_html_uri, push_css_uri)
|
html, css = client.get(push_html_uri, push_css_uri)
|
||||||
verify_status(html.status, 200)
|
verify_status(html.status, 200)
|
||||||
verify_status(css.status, 200)
|
verify_status(css.status, 200)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user