diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/fetch/lib.rs | 9 | ||||
-rw-r--r-- | ext/node/polyfills/http.ts | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index 9fdf80eec..a36512c77 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -745,7 +745,14 @@ pub fn create_http_client( options.client_cert_chain_and_key, )?; - tls_config.alpn_protocols = vec!["h2".into(), "http/1.1".into()]; + let mut alpn_protocols = vec![]; + if options.http2 { + alpn_protocols.push("h2".into()); + } + if options.http1 { + alpn_protocols.push("http/1.1".into()); + } + tls_config.alpn_protocols = alpn_protocols; let mut headers = HeaderMap::new(); headers.insert(USER_AGENT, user_agent.parse().unwrap()); diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index 71186e4e7..3350e8f6e 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -641,6 +641,8 @@ class ClientRequest extends OutgoingMessage { } this._client.close(); const incoming = new IncomingMessageForClient(this.socket); + incoming.req = this; + this.res = incoming; // TODO(@crowlKats): // incoming.httpVersionMajor = versionMajor; |