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

Request fails with NGHTTP2_PROTOCOL_ERROR for http2 requests #2301

Closed
2 tasks done
teammakdi opened this issue Sep 22, 2023 · 2 comments
Closed
2 tasks done

Request fails with NGHTTP2_PROTOCOL_ERROR for http2 requests #2301

teammakdi opened this issue Sep 22, 2023 · 2 comments

Comments

@teammakdi
Copy link

Describe the bug

  • Node.js version: 18.17.0
  • OS & version: Ubuntu
  • Got version: 13.0.0

Actual behavior

RequestError: Stream closed with error code NGHTTP2_PROTOCOL_ERROR

Expected behavior

Response with status 200

Code to reproduce

import got from 'got';

async function main() {
    try {
        const response = await got('https://frasix.it/ads.txt', {
            http2: true,
        });
        console.log(response.body);
    } catch (error) {
        console.log(error);
    }
}

main()

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
Repository owner deleted a comment from teammakdi Nov 10, 2023
Repository owner deleted a comment from teammakdi Nov 10, 2023
Repository owner deleted a comment from a-k-o-r-e-d-e Nov 10, 2023
@szmarczak
Copy link
Collaborator

This is reproducible even without http2-wrapper:

import http2 from 'http2';

const session = http2.connect('https://frasix.it');
const request = session.request({ ':path': '/ads.txt', ':authority': 'frasix.it' });

console.log(request.sentHeaders);

request.pipe(process.stdout);
request.once('response', status => console.log(status));
request.once('close', () => session.unref());

also reproducible with curl:

$ curl --http2 https://frasix.it/ads.txt
curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)

@szmarczak
Copy link
Collaborator

I have created nodejs/node#50660 for you

@szmarczak szmarczak closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants