lib/async/http/protocol/http1/client.rb in async-http-0.47.0 vs lib/async/http/protocol/http1/client.rb in async-http-0.48.0

- old
+ new

@@ -46,9 +46,15 @@ subtask.annotate("Upgrading request.") # If this fails, this connection will be closed. write_upgrade_body(protocol, body) end + elsif request.connect? + task.async do |subtask| + subtask.annotate("Tunnelling body.") + + write_tunnel_body(@version, body) + end else task.async do |subtask| subtask.annotate("Streaming body.") # Once we start writing the body, we can't recover if the request fails. That's because the body might be generated dynamically, streaming, etc.