headers['x-..] in app routes does return undefined, headers.get('x-..) works
Unanswered
Lionhead posted this in #help-forum
LionheadOP
Is this a know issue / intentional? Took me an hour to figure this out today. I am on 13.4.20-canary.11 (can't use latest canary due to a reported regression)
console.log(request.headers['x-api-key']); // -> undefined
console.log(request.headers.get('x-api-key')); --> works1 Reply
@Lionhead Is this a know issue / intentional? Took me an hour to figure this out today. I am on 13.4.20-canary.11 (can't use latest canary due to a reported regression)
console.log(request.headers['x-api-key']); // -> undefined
console.log(request.headers.get('x-api-key')); --> works
It is intentional, the
headers is not an object but iirc a Header instance, you have to use access methods of that instance to access the values