Reputation: 2019
So the accept language header is undefined, even though in the network tab in chrome it shows that it's sent up.
Request URL:http://localhost:3000/
Headers...
Accept-Language:en-US,en;q=0.8
But
export function login(req, res) {
console.log( req.headers["Accept-Language"] );
Prints undefined
import {login} from './login-routes';
app.get('/loadAppAndLogin', login);
I am not really sure why or what to do
Upvotes: 0
Views: 1677
Reputation: 106698
All incoming header names are lowercased in node for consistency:
console.log(req.headers['accept-language']);
Upvotes: 4