Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After login this.connection inside publish is missing keys, for example this.connection.host is undefined #128

Open
claudiutraistaru-cluttered opened this issue Jun 24, 2016 · 0 comments

Comments

@claudiutraistaru-cluttered
Copy link

claudiutraistaru-cluttered commented Jun 24, 2016

In Meteor 1.3(I haven`t tested with 1.2) , even in latest release , when a user is not logged in with the below code :


  Meteor.publish("collection", function () {
        console.log("Publishing Sites " + EJSON.stringify(this.connection));
         ....code to publish
}

when the user is not logged in the below object is returned by this.connection:
{"id":"P4CxJyz6Lpexcretx","clientAddress":"127.0.0.1","httpHeaders":{"x-forwarded-for":"127.0.0.1","host":"localhost:3000","user-agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36","accept-language":"ro-RO,ro;q=0.8,en-US;q=0.6,en;q=0.4"},"headers":{"x-forwarded-proto":"http","x-forwarded-port":"3000","x-forwarded-for":"127.0.0.1","cookie":"cluster-endpoint::web=c941ad20dc843d199a8832622748bcf0b460ca68","accept-language":"ro-RO,ro;q=0.8,en-US;q=0.6,en;q=0.4","accept-encoding":"gzip, deflate, sdch","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","user-agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36","upgrade-insecure-requests":"1","cache-control":"max-age=0","connection":"keep-alive","host":"www.myvirtualdomain.com","x-ip-chain":"127.0.0.1,127.0.0.1"},"headerDep":{"_dependentsById":{}}}
where in particular interest is : host":"www.myvirtualdomain.com" because the requested url is www.myvirtualdomain.com/url

after a user is logged in , this.connection has less keys:
{"id":"miBFW92uWE6s8tsB2","clientAddress":"127.0.0.1","httpHeaders":{"x-forwarded-for":"127.0.0.1","x-forwarded-proto":"ws","host":"localhost:3000","user-agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36","accept-language":"ro-RO,ro;q=0.8,en-US;q=0.6,en;q=0.4"}}
the same request is made on www.myvirtualdomain.com/url , but the only host provided is localhost:3000 which is not the key I need.

This issue appears only after enabling the cluster settings :

Cluster.connect("mongodb://localhost/service-discovery");
Cluster.register("web"); 

if I remove the settings the heaqder is ok when the user is not logged in also.

Is there a workaround to this or is really a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant