Ignore trailing slashes for list routes
This commit is contained in:
parent
92883cbd73
commit
1cb57401b6
2 changed files with 8 additions and 9 deletions
|
@ -19,7 +19,7 @@ template respList*(list, timeline, vnode: typed) =
|
||||||
|
|
||||||
proc createListRouter*(cfg: Config) =
|
proc createListRouter*(cfg: Config) =
|
||||||
router list:
|
router list:
|
||||||
get "/@name/lists/@list":
|
get "/@name/lists/@list/?":
|
||||||
cond '.' notin @"name"
|
cond '.' notin @"name"
|
||||||
cond @"name" != "i"
|
cond @"name" != "i"
|
||||||
let
|
let
|
||||||
|
@ -36,7 +36,7 @@ proc createListRouter*(cfg: Config) =
|
||||||
members = await getListMembers(list)
|
members = await getListMembers(list)
|
||||||
respList(list, members, renderTimelineUsers(members, cookiePrefs(), request.path))
|
respList(list, members, renderTimelineUsers(members, cookiePrefs(), request.path))
|
||||||
|
|
||||||
get "/i/lists/@id":
|
get "/i/lists/@id/?":
|
||||||
cond '.' notin @"id"
|
cond '.' notin @"id"
|
||||||
let list = await getCachedList(id=(@"id"))
|
let list = await getCachedList(id=(@"id"))
|
||||||
if list.id.len == 0:
|
if list.id.len == 0:
|
||||||
|
|
|
@ -6,15 +6,14 @@ import ../views/[general, about]
|
||||||
|
|
||||||
proc createUnsupportedRouter*(cfg: Config) =
|
proc createUnsupportedRouter*(cfg: Config) =
|
||||||
router unsupported:
|
router unsupported:
|
||||||
get "/about/feature":
|
template feature {.dirty.} =
|
||||||
resp renderMain(renderFeature(), request, cfg)
|
resp renderMain(renderFeature(), request, cfg)
|
||||||
|
|
||||||
get "/intent/?@i?":
|
get "/about/feature": feature()
|
||||||
resp renderMain(renderFeature(), request, cfg)
|
get "/intent/?@i?": feature()
|
||||||
|
get "/login/?@i?": feature()
|
||||||
get "/login/?@i?":
|
get "/@name/lists/?": feature()
|
||||||
resp renderMain(renderFeature(), request, cfg)
|
|
||||||
|
|
||||||
get "/i/@i?/?@j?":
|
get "/i/@i?/?@j?":
|
||||||
cond @"i" notin ["status", "lists"]
|
cond @"i" notin ["status", "lists"]
|
||||||
resp renderMain(renderFeature(), request, cfg)
|
feature()
|
||||||
|
|
Loading…
Reference in a new issue