Use sendFile, refactor mimetypes

This commit is contained in:
Zed
2019-10-21 05:55:18 +02:00
parent 59e392e3b4
commit cfcd471ffc
3 changed files with 8 additions and 22 deletions

View File

@@ -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]