Hey,

I'm using Tipfy framework which uses Werkzeug for routing. I'm trying
to route 'www' subdomain to marketing site handlers, and every other
subdomain to user account handlers.

Say I have:

Map([
        Rule('/', endpoint='marketing.home'),
        Subdomain('<subdomain>', [
                Rule('/', endpoint='user.dashboard'),
        ])
], default_subdomain='www')

To my surprise, when I visit 'www.mysite.com' I get routed to
user.dashboard. I would expect fixed strings to take priority over
wildcard rules. I've worked around this problem by specifying
minlength for now:

Map([
        Rule('/', endpoint='marketing.home'),
        Subdomain('<string(minlength=4):subdomain>', [
                Rule('/', endpoint='user.dashboard'),
        ])
], default_subdomain='www')

This isn't a complete solution, though, as I expected to special-case
more subdomains in the future ('status.mysite.com').

Q1: Is the described behaviour expected or is it a bug?
Q2: What solution would you recommend?

Andrey.


-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to