mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-09 00:02:50 -04:00
Merge branch 'issue-93' into 'master'
fix interest calculation on HTTP/2 handshake Closes #93 See merge request honeyryderchuck/httpx!84
This commit is contained in:
commit
74f6c0ae03
@ -20,6 +20,7 @@
|
|||||||
* fixed `compression` plugin not handling `content-encoding: identity` payloads;
|
* fixed `compression` plugin not handling `content-encoding: identity` payloads;
|
||||||
* do not overwrite user-defined `max_requests`on HTTP2 connection handshake;
|
* do not overwrite user-defined `max_requests`on HTTP2 connection handshake;
|
||||||
* `retries` plugin: connection was blocking when a request with body was retried;
|
* `retries` plugin: connection was blocking when a request with body was retried;
|
||||||
|
* `alt-svc: clear` response header was causing the process to hang;
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
@ -281,13 +281,13 @@ module HTTPX
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
log { "READ: #{siz} bytes..." }
|
|
||||||
|
|
||||||
if siz.zero?
|
if siz.zero?
|
||||||
read_drained = @read_buffer.empty?
|
read_drained = @read_buffer.empty?
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
|
log { "READ: #{siz} bytes..." }
|
||||||
|
|
||||||
parser << @read_buffer.to_s
|
parser << @read_buffer.to_s
|
||||||
|
|
||||||
break if @state == :closing || @state == :closed
|
break if @state == :closing || @state == :closed
|
||||||
|
@ -36,7 +36,9 @@ module HTTPX
|
|||||||
|
|
||||||
return :w if @connection.state == :closed
|
return :w if @connection.state == :closed
|
||||||
|
|
||||||
return :r unless (@connection.state == :connected && @handshake_completed)
|
unless (@connection.state == :connected && @handshake_completed)
|
||||||
|
return @buffer.empty? ? :r : :rw
|
||||||
|
end
|
||||||
|
|
||||||
return :w unless @pending.empty?
|
return :w unless @pending.empty?
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ module HTTPX
|
|||||||
#
|
#
|
||||||
def [](field)
|
def [](field)
|
||||||
a = @headers[downcased(field)] || return
|
a = @headers[downcased(field)] || return
|
||||||
a.join(",")
|
a.join(", ")
|
||||||
end
|
end
|
||||||
|
|
||||||
# sets +value+ (if not nil) as single value for the +field+ header.
|
# sets +value+ (if not nil) as single value for the +field+ header.
|
||||||
|
@ -37,6 +37,9 @@ module HTTPX
|
|||||||
|
|
||||||
@timers.fire
|
@timers.fire
|
||||||
end
|
end
|
||||||
|
rescue Interrupt
|
||||||
|
@connections.each(&:reset)
|
||||||
|
raise
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
@connections.each do |connection|
|
@connections.each do |connection|
|
||||||
connection.emit(:error, e)
|
connection.emit(:error, e)
|
||||||
|
@ -25,7 +25,7 @@ class HeadersTest < Minitest::Test
|
|||||||
def test_headers_add
|
def test_headers_add
|
||||||
h1 = Headers.new("accept" => "text/html")
|
h1 = Headers.new("accept" => "text/html")
|
||||||
h1.add("accept", "application/xhtml+xml")
|
h1.add("accept", "application/xhtml+xml")
|
||||||
assert h1["accept"] == "text/html,application/xhtml+xml", "unexpected header value"
|
assert h1["accept"] == "text/html, application/xhtml+xml", "unexpected header value"
|
||||||
assert h1.get("accept") == %w[text/html application/xhtml+xml], "unexpected header value"
|
assert h1.get("accept") == %w[text/html application/xhtml+xml], "unexpected header value"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user