Seeking second opinion and advice on 'req.domains' problem - possible node.js bug

18 views
Skip to first unread message

Aaron Gray

unread,
Jul 10, 2015, 3:47:45 PM7/10/15
to nod...@googlegroups.com
Hi,
 
I have found a bug possibly in node.js itself it manifests in 'req.domains' not being setup correctly AFAICT.
 
I have forked 'express-subdoamin' and added tests which demonstrate the problem.
 

There is a 'debug' branch too that just prints out 'req.domains' in the middleware 'subdomain' function.

Looking at the tests there appears to be an addition problem with 'express-subdomain' too, demonstrated by the first three tests.

Hope someone can clarify this.

--
Aaron

Ryan Graham

unread,
Jul 10, 2015, 4:32:48 PM7/10/15
to nod...@googlegroups.com
It's not clear from your email or the commit message what you think the bug is...

If you are referring to how it assumes the base of the domain is X.Y, there is a setting for that:
 - 'subdomain offset', which defaults to 2

If that's not what the bug you're seeing is, could you elaborate?

~Ryan

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CANkmNDdwcXVVKvcvcFeEr6qNMzng3nTXn4EP_Zy3ExHxttb4PQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Gray

unread,
Jul 10, 2015, 8:07:19 PM7/10/15
to nod...@googlegroups.com
Cheers Ryan,

That solves half my problem. You are right about it being an express
problem rather than a node.js problem. Also the 'subdomain offset'
setting sort of solves the problem.

I would have thought there was a more precise and more pragmatic
solution that actually takes into account IETF domain name standards
(if they are IETF standards rather than tied up in ICANN).
> https://groups.google.com/d/msgid/nodejs/CAGjmZGx%3DBnR9M4gjrKP4r%3DbsFSRiOaO2sE%3DyE-kNSg%2Bux72uhg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages