Order in which Webapp.connectHandlers.use is evaluated

Asked

Viewed 15 times

0

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

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

Ex:

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

and in /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 point is that it is possible for one domain to access another’s code from the url, because Meteor always evaluates what exists in Webapp.clientPrograms['web.browser'] first of all by delivering the file. This logic of mine is only processed if the url does not match anything that Meteor has already "compiled"

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

1 answer

0

I found.

In Meteor there is another instance of connect from which is not in the documentation that is processed before the code created by the developer. It’s the Webappinternals being like this:

WebAppInternals.connectHandlers.use ...

otherwise is equal

Browser other questions tagged

You are not signed in. Login or sign up in order to post.