title: Retries in Node.js got return HTTP 504
body: <p>I am running http server which always returns 504:</p>
  
  <pre><code>const express = require('express')
  const app = express()
  
  app.get('/', (req, res) =&gt; {
      console.log('I AM HERE');
      res.status(504).send('Not found!!');
  })
  
  app.listen(3000, () =&gt; console.log('Listening on port 3000!'))
  </code></pre>
  
  <p>After that, I'm doing request, using <a href="https://github.com/sindresorhus/got#retries" rel="nofollow noreferrer">got</a> with 5 retries:</p>
  
  <pre><code>const got = require('got');
  
  (async () =&gt; {
      try {
          const response = await got('http://localhost:3000/', {retries: 5});
          console.log(response.body);
      } catch (error) {
          console.log(error.response.body);
      }
  })();
  </code></pre>
  
  <p>I'm expecting, that inscription <code>I AM HERE</code> would be logged 5 times, but it logged only once. What is wrong with my code?</p>