Skip to content

Commit 1ae357d

Browse files
committed
improve comment relating to app.before_request handler
1 parent 9d98d86 commit 1ae357d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ide/routes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def parseUrlPath(theRegexp, numGroups):
333333
#
334334

335335
rawPath = '/' + '/'.join(flask.request.base_url.split('/')[3:])
336-
336+
337337
try:
338338
"""
339339
Easy way to guarantee numGroups valid strings regardless.
@@ -380,6 +380,8 @@ def check_for_escaped_hash():
380380
special case to check for escaped hash at beginning of path. Joe Heafner reported a problem where an URL with a '%23'
381381
immidiately after the first '/' would produce a 404. Unfortunatey this happens before our routes are matched, so we
382382
need to handle it in 'before_request'. Here we just check for this situation and redirect using a regular hash/fragment.
383+
It occurst to me that this is a rather expensive check, affecting every single request, however, my attempts to have
384+
flask handle this as an explicit route (e.g., app.route('/%23/<path>')) have unfortunately failed.
383385
"""
384386
url = flask.request.url
385387
p = urllib.parse.urlparse(url)

0 commit comments

Comments
 (0)