Explorar o código

made twitter embed links redirect to nitter ones

Mitarashi %!s(int64=4) %!d(string=hai) anos
pai
achega
ac0edc0a41
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      src/routes/embed.nim

+ 8 - 0
src/routes/embed.nim

@@ -27,3 +27,11 @@ proc createEmbedRouter*(cfg: Config) =
         resp Http404
 
       resp $renderEmbeddedTweet(convo.tweet, cfg, request, prefs, path)
+
+    get "/embed/Tweet.html":
+      let id = @"id"
+
+      if id.len > 0:
+        redirect("/i/status/" & id & "/embed")
+      else:
+        resp Http404