Skip to content

Commit

Permalink
remove cgi deps (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Nov 28, 2022
1 parent 6abcb77 commit 88487c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions karax/tools/static_server.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import
std/[net, os, strutils, uri, mimetypes, asyncnet, asyncdispatch, md5,
logging, httpcore, asyncfile, asynchttpserver, tables, times]
from cgi import decodeUrl

import ws, dotenv

var logger = newConsoleLogger()
Expand Down Expand Up @@ -78,7 +78,7 @@ proc sendStaticIfExists(req: Request, paths: seq[string]): Future[HttpCode] {.as

proc handleFileRequest(req: Request): Future[HttpCode] {.async.} =
# Find static file.
var reqPath = cgi.decodeUrl(req.url.path)
var reqPath = decodeUrl(req.url.path)
var staticDir = getEnv("staticDir") # it's assumed a relative dir
var status = Http400
var path = staticDir / reqPath
Expand Down

0 comments on commit 88487c8

Please sign in to comment.