Skip to content
Myr

Made it theoretically possible to hook into request matching

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 2d946b9 · Browse files · 1 file+12 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−6 removed

  • other:+12 added−6 removed

1 file+12 added−6 removed

modified:flask/ctx.py+12 added-6 removed
88 unmodified lines
89 self.g = _RequestGlobals()90 self.flashes = None91 self.session = None9293 try:94 url_rule, self.request.view_args = \95 self.url_adapter.match(return_rule=True)96 self.request.url_rule = url_rule97 except HTTPException, e:98 self.request.routing_exception = e93 self.match_request()9495 # Support for deprecated functionality. This is doing away with96 # Flask 1.097 blueprint = self.request.blueprint
3 unmodified lines
101 bp = app.blueprints.get(blueprint)102 if bp is not None and blueprint_is_module(bp):103 self.request._is_old_module = True104105 def match_request(self):106 """Can be overridden by a subclass to hook into the matching107 of the request.108 """109 try:110 url_rule, self.request.view_args = \111 self.url_adapter.match(return_rule=True)112 self.request.url_rule = url_rule113 except HTTPException, e:114 self.request.routing_exception = e115116 def push(self):117 """Binds the request context to the current context."""118 _request_ctx_stack.push(self)119
28 unmodified lines