def cookies(self): hdr = self.environ.get('HTTP_COOKIE', '') name = fuzzy.mk_str('cookie_name') val = fuzzy.mk_str('cookie_val') fuzzy.require(hdr == name + '=' + val) res = {name: val} return res
def match(self, path): # print 'match', path, 'rule', self.rule orig = super(SymbolicRule, self).match(path) expectpath = "|" res = {v: fuzzy.mk_str(n) for (v, n) in self.symvarnames.items()} for converter, arguments, variable in werkzeug.routing.parse_rule(self.rule): if arguments is not None: return orig if converter is None: expectpath += variable elif converter is 'default': expectpath += res[variable] fuzzy.require('/' not in res[variable]) else: return orig if expectpath == path: return res else: return orig
def match(self, path): # print 'match', path, 'rule', self.rule orig = super(SymbolicRule, self).match(path) expectpath = "|" res = {v: fuzzy.mk_str(n) for (v, n) in self.symvarnames.items()} for converter, arguments, variable in werkzeug.routing.parse_rule( self.rule): if arguments is not None: return orig if converter is None: expectpath += variable elif converter is 'default': expectpath += res[variable] fuzzy.require('/' not in res[variable]) else: return orig if expectpath == path: return res else: return orig