Skip to content

Commit

Permalink
Fix assets path take request_pathname_prefix into consideration.
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed Aug 24, 2018
1 parent e5f7d20 commit 393f137
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dash/dash.py
Expand Up @@ -327,9 +327,13 @@ def _relative_url_path(relative_package_path='', namespace=''):
'Serving files from absolute_path isn\'t supported yet'
)
elif 'asset_path' in resource:
static_url = flask.url_for('assets.static',
filename=resource['asset_path'],
mod=resource['ts'])
static_url = '/'.join([
# Only take the first part of the pathname
self.config.requests_pathname_prefix.rstrip(
self.config.routes_pathname_prefix),
'assets',
resource['asset_path']
]) + '?m={}'.format(resource['ts'])
srcs.append(static_url)
return srcs

Expand Down

0 comments on commit 393f137

Please sign in to comment.