adding support for the origin frame

This commit is contained in:
HoneyryderChuck 2019-12-14 16:48:23 +00:00
parent ab67491a55
commit e6ec9cb43e
2 changed files with 8 additions and 0 deletions

View File

@ -274,6 +274,9 @@ module HTTPX
parser.on(:promise) do |request, stream|
request.emit(:promise, parser, stream)
end
parser.on(:origin) do |origin|
@origins << origin
end
parser.on(:close) do
transition(:closing)
end

View File

@ -107,6 +107,7 @@ module HTTPX
@connection.on(:frame, &method(:on_frame))
@connection.on(:frame_sent, &method(:on_frame_sent))
@connection.on(:frame_received, &method(:on_frame_received))
@connection.on(:origin, &method(:on_origin))
@connection.on(:promise, &method(:on_promise))
@connection.on(:altsvc) { |frame| on_altsvc(frame[:origin], frame) }
@connection.on(:settings_ack, &method(:on_settings))
@ -265,6 +266,10 @@ module HTTPX
emit(:promise, @streams.key(stream.parent), stream)
end
def on_origin(origin)
emit(:origin, origin)
end
def respond_to_missing?(meth, *args)
@connection.respond_to?(meth, *args) || super
end