Skip to content

Http: error sending request for url (<URL>): http2 error: protocol error: endpoint requires HTTP/1.1 #8333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
breezy-badger opened this issue Nov 10, 2020 · 7 comments
Labels
bug Something isn't working correctly ext/fetch related to the ext/fetch

Comments

@breezy-badger
Copy link

breezy-badger commented Nov 10, 2020

Certain requests that work through Chrome console(and Node as well) fails through deno.

Steps to reproduce

$ cat test.js
fetch("https://localhost:4000").catch(console.log)
$ deno run --allow-all ./test.js
Http: error sending request for url (https://localhost:4000): http2 error: protocol error: endpoint requires HTTP/1.1
    at processResponse (core.js:224:13)
    at Object.jsonOpAsync (core.js:242:12)
    at async fetch (deno:op_crates/fetch/26_fetch.js:1274:29)

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.

@kitsonk kitsonk added the duplicate a duplicate of another issue label Nov 10, 2020
@kitsonk
Copy link
Contributor

kitsonk commented Nov 10, 2020

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 kitsonk closed this as completed Nov 10, 2020
@lucacasonato
Copy link
Member

@kitsonk fetch() does support HTTP/2 (it is done by reqwest in Rust).

@lucacasonato lucacasonato reopened this Nov 10, 2020
@lucacasonato lucacasonato removed the duplicate a duplicate of another issue label Nov 10, 2020
@ry ry added bug Something isn't working correctly cli related to cli/ dir labels Nov 10, 2020
@Skillz4Killz
Copy link

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.

image

@lucacasonato
Copy link
Member

@breezy-badger We'll need more details. Do you have a test case I can execute that fails?

@breezy-badger
Copy link
Author

@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 ;)

@breezy-badger
Copy link
Author

The above code works fine in both Chrome console as well as Node.

@crowlKats crowlKats added ext/fetch related to the ext/fetch and removed cli related to cli/ dir labels Nov 30, 2023
@lucacasonato
Copy link
Member

I can not reproduce this using either of the reproductions anymore. Please re-open if you still run into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly ext/fetch related to the ext/fetch
Projects
None yet
Development

No branches or pull requests

6 participants