# HG changeset patch # User Jeff Hammel # Date 1356927830 28800 # Node ID d30118837c1ae27aa9fcb6e388b8b085b4fe173c # Parent 3a1fb496b47db465eb3669c2e27e0c1907b8873a dunno diff -r 3a1fb496b47d -r d30118837c1a wsgintegrate/match.py --- a/wsgintegrate/match.py Sun Dec 30 20:11:48 2012 -0800 +++ b/wsgintegrate/match.py Sun Dec 30 20:23:50 2012 -0800 @@ -87,6 +87,10 @@ def __init__(self, app, host, port=None): RequestMatch.__init__(self, app) + self.wildcard = False + if host.startswith('*.'): + self.wildcard = True + host = host[len('*.'):] self.host = host self.port = port @@ -99,10 +103,8 @@ host, port = host.rsplit(':', 1) if self.port and port != self.port: return False - if host.startswith('*.'): - # wildcard - if host.endswith('.' + self.host[len('*.'):]): - return True + if self.wildcard and host.endswith('.' + self.host): + return True # wildcard return host == self.host class MatchAuthorized(RequestMatch):