optional theme in tile server URLs
theme is not optional in core because it has optional access restrictions already, but in an actual deployment all tiles are loaded through the tile server, and this is only for backwards compatibility with external services
This commit is contained in:
parent
59317f9a42
commit
0e72967698
1 changed files with 4 additions and 2 deletions
|
@ -32,7 +32,7 @@ if os.environ.get('C3NAV_LOGFILE'):
|
|||
|
||||
class TileServer:
|
||||
def __init__(self):
|
||||
self.path_regex = re.compile(r'^/(\d+)/(-?\d+)/(-?\d+)/(-?\d+)/(-?\d+).png$')
|
||||
self.path_regex = re.compile(r'^/(\d+)/(-?\d+)/(-?\d+)/(-?\d+)(/(-?\d+))?.png$')
|
||||
|
||||
self.cookie_regex = re.compile(r'(^| )c3nav_tile_access="?([^;" ]+)"?')
|
||||
|
||||
|
@ -239,7 +239,9 @@ class TileServer:
|
|||
if match is None:
|
||||
return self.not_found(start_response, b'invalid tile path.')
|
||||
|
||||
level, zoom, x, y, theme = match.groups()
|
||||
level, zoom, x, y, _, theme = match.groups()
|
||||
if theme is None:
|
||||
theme = 0
|
||||
|
||||
zoom = int(zoom)
|
||||
if not (-2 <= zoom <= 5):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue