mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-18 00:00:56 -04:00
adding support for the origin frame
This commit is contained in:
parent
ab67491a55
commit
e6ec9cb43e
@ -274,6 +274,9 @@ module HTTPX
|
|||||||
parser.on(:promise) do |request, stream|
|
parser.on(:promise) do |request, stream|
|
||||||
request.emit(:promise, parser, stream)
|
request.emit(:promise, parser, stream)
|
||||||
end
|
end
|
||||||
|
parser.on(:origin) do |origin|
|
||||||
|
@origins << origin
|
||||||
|
end
|
||||||
parser.on(:close) do
|
parser.on(:close) do
|
||||||
transition(:closing)
|
transition(:closing)
|
||||||
end
|
end
|
||||||
|
@ -107,6 +107,7 @@ module HTTPX
|
|||||||
@connection.on(:frame, &method(:on_frame))
|
@connection.on(:frame, &method(:on_frame))
|
||||||
@connection.on(:frame_sent, &method(:on_frame_sent))
|
@connection.on(:frame_sent, &method(:on_frame_sent))
|
||||||
@connection.on(:frame_received, &method(:on_frame_received))
|
@connection.on(:frame_received, &method(:on_frame_received))
|
||||||
|
@connection.on(:origin, &method(:on_origin))
|
||||||
@connection.on(:promise, &method(:on_promise))
|
@connection.on(:promise, &method(:on_promise))
|
||||||
@connection.on(:altsvc) { |frame| on_altsvc(frame[:origin], frame) }
|
@connection.on(:altsvc) { |frame| on_altsvc(frame[:origin], frame) }
|
||||||
@connection.on(:settings_ack, &method(:on_settings))
|
@connection.on(:settings_ack, &method(:on_settings))
|
||||||
@ -265,6 +266,10 @@ module HTTPX
|
|||||||
emit(:promise, @streams.key(stream.parent), stream)
|
emit(:promise, @streams.key(stream.parent), stream)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def on_origin(origin)
|
||||||
|
emit(:origin, origin)
|
||||||
|
end
|
||||||
|
|
||||||
def respond_to_missing?(meth, *args)
|
def respond_to_missing?(meth, *args)
|
||||||
@connection.respond_to?(meth, *args) || super
|
@connection.respond_to?(meth, *args) || super
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user