lib/async/http/protocol/http2/stream.rb in async-http-0.60.2 vs lib/async/http/protocol/http2/stream.rb in async-http-0.61.0
- old
+ new
@@ -48,25 +48,23 @@
add_header(key, value)
end
end
def process_headers(frame)
- if @headers.nil?
- @headers = ::Protocol::HTTP::Headers.new
- self.receive_initial_headers(super, frame.end_stream?)
- elsif frame.end_stream?
+ if frame.end_stream? && @headers
self.receive_trailing_headers(super, frame.end_stream?)
else
- raise ::Protocol::HTTP2::HeaderError, "Unable to process headers!"
+ @headers ||= ::Protocol::HTTP::Headers.new
+ self.receive_initial_headers(super, frame.end_stream?)
end
# TODO this might need to be in an ensure block:
if @input and frame.end_stream?
@input.close($!)
@input = nil
end
rescue ::Protocol::HTTP2::HeaderError => error
- Console.logger.error(self, error)
+ Console.logger.debug(self, error)
send_reset_stream(error.code)
end
def wait_for_input