Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
nsthorat committed Feb 13, 2024
1 parent 9f15d12 commit c683213
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lilac/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,14 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
"""Redirect trailing slashes to non-trailing slashes."""
url = URL(scope=scope).path
print('url=', url)
root_path = scope.get('root_path')
root_path = scope.get('root_path') or ''
ends_with_slash = (
url.endswith('/')
and url != '/'
and root_path
and url != root_path
and url != root_path + '/'
and not url.startswith('/api')
and not url.startswith(root_path + '/api')
)
# ends_with_slash = url.endswith('/') and url != '/' and not url.startswith('/api')

Expand Down

0 comments on commit c683213

Please sign in to comment.