order in which WebApp.connectHandlers.use is evaluated

0

In a test application, I have several dns records pointing to it, and I have a folder where I keep specific codes for each source.

What I want to avoid is the possibility of requesting content from one site to another, but the problem is that all queries for the internal elements of the Meteor are evaluated first.

Ex:

/imports/@/bulica.local/index.js
/imports/@/caneco.local/index.js
/imports/@/192.168.0.1/index.js

and /server/index.js in the first few instructions:

WebApp.connectHandlers.use('/imports/@/', (req, res, next) => {
  //  aqui vai minha lógica que compara
  //  req._parsedUrl.pathname com req.headers['x-forwarded-server'] 
});

The issue is that it is possible for one domain to access code from another through url, because Meteor always evaluates what exists in WebApp.clientPrograms ['web.browser'] first, delivering the file. This logic is only processed if the url does not marry anything that the Meteor has already "compiled"

How to solve this? I have no idea how to do this in Apache, which also occurred to me

    
asked by anonymous 19.03.2018 / 21:40

1 answer

0

I found it.

In Meteor there is another instance of connect that is not in the documentation that is processed before the code created by the developer. It's WebAppInternals and looks like this:

WebAppInternals.connectHandlers.use ...

rest is equal

    
28.03.2018 / 15:40