Skip to content

Commit

Permalink
[common/utils] consider not matching paths as static
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonygego committed Nov 24, 2021
1 parent f63eaec commit fcb5ec6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ictv/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from ictv.models.role import UserPermissions
from ictv.models.user import User

from werkzeug.exceptions import NotFound
import ictv.flask.response as resp


Expand Down Expand Up @@ -245,6 +246,9 @@ def get_methods(elem):
return [m for m in http_methods if elem.__dict__.get(m.lower())!=None]

def request_static():
endpoint, _ = flask.current_app.create_url_adapter(flask.request).match()
try:
endpoint, _ = flask.current_app.create_url_adapter(flask.request).match()
except NotFound:
return True
return endpoint == 'static'

0 comments on commit fcb5ec6

Please sign in to comment.