denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.33k stars 5.36k forks source link

HTTP protocol option for Deno.createHttpClient() #13587

Open Sembiance opened 2 years ago

Sembiance commented 2 years ago

I ran into an issue today where using fetch() would fail because the destination web server was mis-behaving with HTTP/2 requests.

Using HTTP 1.0/1.1 via command line works fine, but neither fetch() nor Deno.createHttpClient() have the ability to be forced to use HTTP 1.0/1.1.

I spoke with @andreubotella on Discord and he suggested I file this issue and suggest it as an option for Deno.createHttpClient()

zachauten commented 2 years ago

Looks like the protocols for the http client are assigned here. Maybe they could be passed via CreateHttpClientOptions?