Add /i/redirect support

Fixes #77
This commit is contained in:
Zed 2019-10-18 00:45:54 +02:00
parent 8ddb913912
commit d52769009b
1 changed files with 6 additions and 1 deletions

View File

@ -3,7 +3,7 @@ from net import Port
import jester
import types, config, prefs
import types, config, prefs, formatters
import views/[general, about]
import routes/[
preferences, timeline, status, media, search, rss, list, unsupported]
@ -38,6 +38,11 @@ routes:
get "/help":
redirect("/about")
get "/i/redirect":
let url = decodeUrl(@"url")
if url.len == 0: halt Http404
redirect(replaceUrl(url, cookiePrefs()))
error Http404:
resp showError("Page not found", cfg.title)