Explorar el Código

made twitter embed links redirect to nitter ones

Mitarashi hace 4 años
padre
commit
ac0edc0a41
Se han modificado 1 ficheros con 8 adiciones y 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