Hint for Request Parser Microservice

app.get("/api/whoami/", function(req,res){

  const ipAddress=req.headers['x-forwarded-for'] || 
     req.connection.remoteAddress || 
     req.socket.remoteAddress ||
     (req.connection.socket ? req.connection.socket.remoteAddress : null);

  const defaultLang=req.headers["accept-language"];

  res.json({"ipaddress":ipAddress,"language":defaultLang,
"software":req.headers['user-agent']})
});


Challenge: Request Header Parser Microservice

Link to the challenge:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.