express redirect sets statusCode to 200 instead of 302
<p>Below is my case, I want to do a redirect from a post.</p>

<pre><code>router.post('/saveUser', function(req,res) {

      // code to call service and get saved userId....

      res.redirect('viewUser/{savedUserId}');
});

router.get('ViewUser/:userId', function(req, res) {
       // here am expecting the res.statusCode to be 302 but instead it is 200

       console.log('StatusCode' + res.statusCode);
       res.render('views/User');
});
</code></pre>

<p>Am expecting res.statusCode to be 302 instead it is coming as 200. I have tried the below other options too, but no ,luck</p>

<pre><code>res.redirect(302, 'viewUser/{savedUserId}');

res.statusCode = 302;
res.setHeader('Location', 'viewUser/{savedUserId}');
res.end();
</code></pre>

<p>In the ViewUser route, I want to determine whether it is a redirect or not, depending on that, the view will change a little bit.</p>

<p>Is there a way to accomplish this ?</p>