Skip to content

Commit

Permalink
fix: Remove leading slash from prefix if specified. #1796
Browse files Browse the repository at this point in the history
  • Loading branch information
mturoci committed Feb 24, 2023
1 parent ec13ec8 commit 67c212a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions py/h2o_wavelite_web/h2o_wavelite_web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@

# TODO: Inject web_files to this file during build time. No need to read index.html at runtime.
def get_web_files(prefix: str = '') -> str:
if prefix and not prefix.endswith('/'):
prefix += '/'
if prefix:
if not prefix.endswith('/'):
prefix += '/'
if prefix.startswith('/'):
prefix = prefix[1:]

web_files = []
with open(os.path.join(web_directory, 'index.html'), 'r') as f:
Expand Down

0 comments on commit 67c212a

Please sign in to comment.