Recently faced a problem with fetching 'Origin' request header, then I found this question. But pretty confused with the results, req.get('host') is now deprecated, that's why givingusing it will give Undefined.
Use
Use,
req.header('Origin');
req.header('Host');
// this method can be used to access other request headers like, 'Referer', 'User-Agent' etc.