lib/httpx/connection/http2.rb in httpx-0.18.4 vs lib/httpx/connection/http2.rb in httpx-0.18.5
- old
+ new
@@ -218,9 +218,15 @@
}
end
def join_headers(stream, request)
extra_headers = set_protocol_headers(request)
+
+ if request.headers.key?("host")
+ log { "forbidden \"host\" header found (#{request.headers["host"]}), will use it as authority..." }
+ extra_headers[":authority"] = request.headers["host"]
+ end
+
log(level: 1, color: :yellow) do
request.headers.merge(extra_headers).each.map { |k, v| "#{stream.id}: -> HEADER: #{k}: #{v}" }.join("\n")
end
stream.headers(request.headers.each(extra_headers), end_stream: request.body.empty?)
end