How to prevent express from sending "502 Bad Gateway" when I don't answer a request?

Viewed 2068

For a special use case with an express 4 server (forcing a client, that doesn't respond to 503 status code repeat a request) I need to not respond to a client request at all.

But Express sends a 502 Bad Gateway after apr. 2 minutes, when I just omit to send a result. How can I achieve this?

I tried to catch the timeout, but that doesn't help:

app.use((req, res, next) => {
  if (!req.timedout) {
    next();
    return;
  }

  console.log('Timeout!')
});
1 Answers
Related