Closed breezy-badger closed 3 weeks ago
Deno fetch()
does not currently support HTTP/2. The server you are connecting to only supports HTTP/2, therefore the error.
Duplicate of #3995
@kitsonk fetch()
does support HTTP/2 (it is done by reqwest
in Rust).
Not sure if this is entirely related but the issue feels very similar. My libs users have been reporting this to me and I have no idea what could be causing it.
@breezy-badger We'll need more details. Do you have a test case I can execute that fails?
@lucacasonato
$ cat test.js fetch("https://book.hotelvejlefjord.dk/umbraco/api/hotel/available?lang=da-DK&arrival=2021-08-13&departure=2021-08-14&participants=2").catch(console.log)
$deno run --allow-all ./test.js TypeError: error sending request for url (https://book.hotelvejlefjord.dk/umbraco/api/hotel/available?lang=da-DK&arrival=2021-08-13&departure=2021-08-14&participants=2): http2 error: protocol error: endpoint requires HTTP/1.1 at deno:core/01_core.js:106:46 at unwrapOpResult (deno:core/01_core.js:126:13) at async mainFetch (deno:extensions/fetch/26_fetch.js:253:14)
It might be caused by this booking system returning the Http 204 status code for dates with no available rooms https://book.hotelvejlefjord.dk/da/step/1?arrival=2021-08-13&departure=2021-08-14&rooms=%5B%7B%22services%22:%5B%5D,%22adults%22:2,%22roomType%22:null%7D%5D
While that might be a bit strange, it should still be handled. Be aware that the provided example above might not fail later today or tomorrow if a room becomes available. If that is the case, I guess I have to find a new date without a room for two people ;)
The above code works fine in both Chrome console as well as Node.
I can not reproduce this using either of the reproductions anymore. Please re-open if you still run into this.
Certain requests that work through Chrome console(and Node as well) fails through deno.
Steps to reproduce
Expected result
That deno supports https/2
In case the provided error-message isn’t enough, I can find an external URL where the issue can be reproduced.