Unable to Retrieve client-time Header in Node.js Server ( cloudflare tunnel)

19 Views Asked by At

I am developing a Node.js server that relies on the client-time header to determine opening hours. However, I am unable to retrieve the client-time header from incoming HTTP requests. I have confirmed that the header is being sent in my cURL requests, but the server is not capturing it.

Here's a simplified snippet of my server code:


const server = http.createServer((req, res) => {
  const clientTime = req.headers['client-time'];
  console.log('Client Time:', clientTime);

  // ... (rest of the server logic)
});



Checked cURL requests to ensure that the client-time header is being sent. Reviewed server logs to verify if the header is captured. Examined the server code to ensure there are no syntax errors or logical issues. Considered potential interference from firewall or security settings.

0

There are 0 best solutions below