Nodejs detect browser pushState

I currently have res.redirect('/login') but this will not work for browsers not supporting pushState. So I need a way to detect the user browser so that I can redirect with res.redirect('/#login') for browsers not supporting pushState.
How can I detect if the user browser supports pushState or not in Nodejs?

You could implement ua-parser and then use the, Can I use... matrix to build which browser versions support it. It's not very ideal but I can't think of another way to feature detect from node.

You can use a cookie to transport that value to the server. Otherwise, it will be pretty hard to distinguish between clients (eg. in case you want to send an HTTP request containing the relevant data). To receive the cookie, you would need to send an HTTP request after setting it.

Using user agents to detect features is not future-proof, don't do that.

As a side-note: After Twitter removed support for hash-bangs recently, you could continue to support this great way of showing an users position on a webpage. (Seriously, don't do that.)