There is a global headers object on the server which gets set each time a client connects. However, this is global, and gets changed with every new client connection.
The Meteor.call('getReqHeaders') is therefore actually fetching the most recent headers, and not necessarily the headers for the current connection (if another client connected before then, which is very likely on popular sites).
We can store the headers per connection, but we currently have no way to associate a Meteor.method with a particular connection. It's critical that we investigate other ways of doing this or put in a feature request to MDG.
There is a global
headers
object on the server which gets set each time a client connects. However, this is global, and gets changed with every new client connection.The
Meteor.call('getReqHeaders')
is therefore actually fetching the most recent headers, and not necessarily the headers for the current connection (if another client connected before then, which is very likely on popular sites).We can store the headers per connection, but we currently have no way to associate a Meteor.method with a particular connection. It's critical that we investigate other ways of doing this or put in a feature request to MDG.