mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Use referer form data instead of relying on header
This commit is contained in:
parent
f7c1c28368
commit
1e55f21fa5
10 changed files with 94 additions and 56 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import strutils
|
||||
import karax/[karaxdsl, vdom, vstyles]
|
||||
|
||||
import ../types, ../utils
|
||||
|
|
@ -37,3 +38,9 @@ proc linkText*(text: string; class=""): VNode =
|
|||
let url = if "http" notin text: "http://" & text else: text
|
||||
buildHtml():
|
||||
a(href=url, class=class): text text
|
||||
|
||||
proc iconReferer*(icon, action, path: string, title=""): VNode =
|
||||
buildHtml(form(`method`="get", action=action, class="icon-button")):
|
||||
verbatim "<input name=\"referer\" style=\"display: none\" value=\"$1\"/>" % path
|
||||
button(`type`="submit"):
|
||||
icon icon, title=title
|
||||
|
|
|
|||
Loading…
Reference in a new issue