mercredi 22 février 2017

Read Route Request Headers

I have an emberjs app where all requests are sent through a proxy that inserts some user information into the header. In my ember app I would like to read that header data and save it as a 'current user' object for every route. I cannot find how I would get access to the route request headers.

In a node app I would do this:

app.get('/', function(req, res){
  req.get('Content-Type');
});

But my emberjs route looks like this (no request variable):

Router.map(function() {
 this.route('dashboard');
}

How do I get a request object in emberjs to read the headers?




Aucun commentaire:

Enregistrer un commentaire