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,4 +1,4 @@
|
|||
import strutils, strformat, uri
|
||||
import strutils, strformat, sequtils, uri, tables
|
||||
import nimcrypto, regex
|
||||
|
||||
const key = "supersecretkey"
|
||||
|
|
@ -25,3 +25,7 @@ proc getSigUrl*(link: string; path: string): string =
|
|||
proc cleanFilename*(filename: string): string =
|
||||
const reg = re"[^A-Za-z0-9._-]"
|
||||
filename.replace(reg, "_")
|
||||
|
||||
proc filterParams*(params: Table): seq[(string, string)] =
|
||||
let filter = ["name", "id"]
|
||||
toSeq(params.pairs()).filterIt(it[0] notin filter)
|
||||
|
|
|
|||
Loading…
Reference in a new issue