class Async::HTTP::Protocol::HTTP2::Request

def send_response(response)

def send_response(response)
	if response.nil?
		@stream.send_headers(nil, NO_RESPONSE, ::Protocol::HTTP2::END_STREAM)
	elsif response.body?
		pseudo_headers = [
			[STATUS, response.status],
		]
		
		if protocol = response.protocol
			pseudo_headers << [PROTOCOL, protocol]
		end
		
		if length = response.body.length
			pseudo_headers << [CONTENT_LENGTH, length]
		end
		
		headers = ::Protocol::HTTP::Headers::Merged.new(
			pseudo_headers,
			response.headers
		)
		
		@stream.send_headers(nil, headers)
		@stream.send_body(response.body)
	else
		headers = ::Protocol::HTTP::Headers::Merged.new([
			[STATUS, response.status],
		], response.headers)
		
		@stream.send_headers(nil, headers, ::Protocol::HTTP2::END_STREAM)
	end
end