mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 07:09:31 +00:00
Use sendFile, refactor mimetypes
This commit is contained in:
parent
59e392e3b4
commit
cfcd471ffc
3 changed files with 8 additions and 22 deletions
|
|
@ -11,16 +11,6 @@ const
|
|||
"video.twimg.com"
|
||||
]
|
||||
|
||||
proc mimetype*(filename: string): string =
|
||||
if ".png" in filename:
|
||||
"image/" & "png"
|
||||
elif ".jpg" in filename or ".jpeg" in filename or "1500x500" in filename:
|
||||
"image/" & "jpg"
|
||||
elif ".mp4" in filename:
|
||||
"video/" & "mp4"
|
||||
else:
|
||||
"text/plain"
|
||||
|
||||
proc getHmac*(data: string): string =
|
||||
($hmac(sha256, key, data))[0 .. 12]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue