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

koa-body hangs after some requests with HTTP2 server #169

Open
damianobarbati opened this issue Jan 5, 2020 · 0 comments
Open

koa-body hangs after some requests with HTTP2 server #169

damianobarbati opened this issue Jan 5, 2020 · 0 comments

Comments

@damianobarbati
Copy link

I have this bug with http2 module, it does not happen with https module.
Not sure whether this is related to #154.

Node version 12.14.0

To reproduce:

yarn install
node -r esm index.js # start
curl -k https://localhost -d 'ciao=1' # keep firing requests until it hangs

File package.json:

{
  "dependencies": {
    "esm": "^3.2.25",
    "koa": "^2.11.0",
    "koa-body": "^4.1.1"
  }
}

File index.js:

import fs from 'fs';
import http2 from 'http2';
import koa from 'koa';
import body from 'koa-body';

const app = new koa();

app.use(body({ multipart: true, formidable: { maxFileSize: '4mb' } }));

app.use(async ctx => ctx.body = 'ciao');

const HTTPS = 443;

const cert = fs.readFileSync('./ssl/fullchain.pem');
const ca = fs.readFileSync('./ssl/chain.pem');
const key = fs.readFileSync('./ssl/privkey.pem');

http2.createSecureServer({ cert, ca, key }, app.callback()).listen(HTTPS, error => error ? console.error(error) : console.info(`https serving on port ${HTTPS}`));
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

1 participant