lib/httpx/connection/http2.rb in httpx-0.14.0 vs lib/httpx/connection/http2.rb in httpx-0.14.1

- old
+ new

@@ -190,21 +190,23 @@ stream.on(:headers, &method(:on_stream_headers).curry(3)[stream, request]) stream.on(:data, &method(:on_stream_data).curry(3)[stream, request]) end def set_protocol_headers(request) - request.headers[":scheme"] = request.scheme - request.headers[":method"] = request.verb.to_s.upcase - request.headers[":path"] = headline_uri(request) - request.headers[":authority"] = request.authority + { + ":scheme" => request.scheme, + ":method" => request.verb.to_s.upcase, + ":path" => headline_uri(request), + ":authority" => request.authority, + } end def join_headers(stream, request) - set_protocol_headers(request) + extra_headers = set_protocol_headers(request) log(level: 1, color: :yellow) do - request.headers.each.map { |k, v| "#{stream.id}: -> HEADER: #{k}: #{v}" }.join("\n") + request.headers.merge(extra_headers).each.map { |k, v| "#{stream.id}: -> HEADER: #{k}: #{v}" }.join("\n") end - stream.headers(request.headers.each, end_stream: request.empty?) + stream.headers(request.headers.each(extra_headers), end_stream: request.empty?) end def join_trailers(stream, request) unless request.trailers? stream.data("", end_stream: true) if request.callbacks_for?(:trailers)