don't accept RegExp grammar in vhost's hostname #747

Merged
merged 1 commit into from Feb 12, 2013

2 participants

@telendt

There are some side-effects of current implementation of hostname wildcards in vhost middleware. It dynamically creates a RegExp by replacing the star but leaves other special characters intact.

https://github.com/senchalabs/connect/blob/master/lib/middleware/vhost.js#L31

I assume that this behavior is not expected (e.g. "dot" should match "dot", not any character). Escaping all RegExp special characters (or easier - all non-alphanumeric characters) should solve the problem.

@tj tj merged commit 7dbd875 into senchalabs:master Feb 12, 2013

1 check failed

Details default The Travis build failed
@telendt

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment