lib/httpx/connection/http1.rb in httpx-0.18.6 vs lib/httpx/connection/http1.rb in httpx-0.18.7
- old
+ new
@@ -295,14 +295,10 @@
extra_headers = { "connection" => connection }
extra_headers["host"] = request.authority unless request.headers.key?("host")
extra_headers
end
- def headline_uri(request)
- request.path
- end
-
def handle(request)
catch(:buffer_full) do
request.transition(:headers)
join_headers(request) if request.state == :headers
request.transition(:body)
@@ -312,11 +308,15 @@
join_trailers(request) if request.body.chunked? && request.state == :trailers
request.transition(:done)
end
end
+ def join_headline(request)
+ "#{request.verb.to_s.upcase} #{request.path} HTTP/#{@version.join(".")}"
+ end
+
def join_headers(request)
- headline = "#{request.verb.to_s.upcase} #{headline_uri(request)} HTTP/#{@version.join(".")}"
+ headline = join_headline(request)
@buffer << headline << CRLF
log(color: :yellow) { "<- HEADLINE: #{headline.chomp.inspect}" }
extra_headers = set_protocol_headers(request)
join_headers2(request.headers.each(extra_headers))
log { "<- " }