lib/async/http/protocol/http1/request.rb in async-http-0.40.3 vs lib/async/http/protocol/http1/request.rb in async-http-0.41.0
- old
+ new
@@ -23,26 +23,29 @@
module Async
module HTTP
module Protocol
module HTTP1
class Request < Protocol::Request
- def self.read(protocol)
- if parts = protocol.read_request
- self.new(protocol, *parts)
+ def self.read(connection)
+ if parts = connection.read_request
+ self.new(connection, *parts)
end
end
- def initialize(protocol, *parts)
- super(nil, *parts)
- @protocol = protocol
+ def initialize(connection, authority, method, path, version, headers, body)
+ @connection = connection
+
+ protocol = connection.upgrade?(headers)
+
+ super(nil, authority, method, path, version, headers, body, protocol)
end
def hijack?
true
end
def hijack!
- @protocol.hijack!
+ @connection.hijack!
end
end
end
end
end