title: passing referer from the client and getting the headers.referer in node.js
body: <p>I have several sites, I want to check which site call my api, I did this in node.js</p>
  
  <pre><code>  const mySite = req.headers &amp;&amp; req.headers.referer.split('/')[2]
  </code></pre>
  
  <p>in normal case I will get mysite1.com, myothersite.net but is above code 'safe'? In what case headers is not present? If I call from POSTMAN and don't put header will it cause any problem for above code?</p>