mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-06 09:57:57 +00:00
Handle symlinks properly in the directory browser.
This change properly handles symlinks by expanding any it finds in the path and issuing a redirect to the canonical location. Whilst we're here, display links as such on the pages, sort directory listings so the parent link is always at the top, and avoid unnecessary redirects caused by missing /'s on URLs.
This commit is contained in:
@ -41,7 +41,7 @@ def version_sort(l):
|
||||
"""
|
||||
map a directory name to a format that will show up sensibly in an ascii sort
|
||||
"""
|
||||
mkey = l['url']
|
||||
mkey = l['link']
|
||||
m = re.match('v([0-9]+)\.([0-9]+)\.([0-9]+)$',l['url'])
|
||||
if m:
|
||||
mkey = m.group(1) + '%02d' % int(m.group(2)) + '%02d' % int(m.group(3));
|
||||
|
Reference in New Issue
Block a user