lib/httpx/plugins/h2c.rb in httpx-0.6.3 vs lib/httpx/plugins/h2c.rb in httpx-0.6.4
- old
+ new
@@ -28,13 +28,11 @@
upgrade_request.headers["http2-settings"] = HTTP2Next::Client.settings_header(upgrade_request.options.http2_settings)
wrap { send_requests(*upgrade_request, h2c_options).first }
responses = send_requests(*requests, h2c_options)
- return responses.first if responses.size == 1
-
- responses
+ responses.size == 1 ? responses.first : responses
end
private
def fetch_response(request, connections, options)
@@ -105,20 +103,9 @@
def build_parser(*)
return super unless @origin.scheme == "http"
super("http/1.1")
- end
- end
-
- module FrameBuilder
- include HTTP2Next
-
- module_function
-
- def settings_value(settings)
- frame = Framer.new.generate(type: :settings, stream: 0, payload: settings)
- Base64.urlsafe_encode64(frame[9..-1])
end
end
end
register_plugin(:h2c, H2C)
end