Skip to content
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

node:http2 client request fails with connection error detected: frame with invalid size #22479

Closed
satyarohith opened this issue Feb 19, 2024 · 0 comments · Fixed by #22512
Closed
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@satyarohith
Copy link
Member

satyarohith commented Feb 19, 2024

➜  p deno --version              
deno 1.40.5 (release, aarch64-apple-darwin)
v8 12.1.285.27
typescript 5.3.3
➜  p cat t.mjs --plain
import http2 from "node:http2";

const clientSession = http2.connect("https://www.example.com");
const req = clientSession.request({
  ":method": "GET",
  ":path": "/",
});
req.on("response", (headers) => {
  console.log(
    `Status code: ${headers[":status"]} (headers received: ${
      Object.keys(headers).length
    })`,
  );
});
req.on("data", (chunk) => {
  console.log("Received body of size", chunk.toString().length);
});
req.on("end", () => {
  console.log("Response ended");
  clientSession.close();
});
req.end();

➜  p node t.mjs       
Status code: 200 (headers received: 13)
Received body of size 1256
Response ended

➜  p deno run -A t.mjs
error: Uncaught (in promise) Error: connection error detected: frame with invalid size
    at async node:http2:291:11
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 node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant