Router cleanup

This commit is contained in:
Brahim Hadriche committed 2022-11-28 12:19:40 -05:00
1 parent e0cc6970ab
commit 27b4ad90d3
6 files changed
+29 -47

No files matched your search

@@ -8,16 +8,10 @@ namespace Http
function new()
super()
m.Get("*", function(context as object) as boolean
m.Get("/api/state", function(context as object) as boolean
request = context.request
response = context.response
route = request.uri
' TODO: this is not the right filtering. /api/state/something will go through, which is not correct
if not route.StartsWith("/api/state")
return false
end if
keys = ["app", "device", "invidious"]
if request.query.DoesExist("key")