Skip to content

Commit

Permalink
solve issues for httpx and httpbeast
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethosa committed Nov 16, 2024
1 parent e6ecb84 commit 4952817
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/happyx/ssr/server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,14 @@ macro routes*(server: Server, body: untyped = newStmtList()): untyped =
body.handleLiveViews()

when enableHttpx or enableHttpBeast or enableBuiltin:
var path = newCall("decodeUrl", ident"urlPath")
var path =
when enableBuiltin:
newCall("decodeUrl", ident"urlPath")
else:
newCall("decodeUrl", newNimNode(nnkBracketExpr).add(
newCall("split", newCall("get", newCall("path", ident"req")), newLit('?')),
newLit(0)
))
let
reqMethod = newCall("get", newDotExpr(ident"req", ident"httpMethod"))
hostname = newDotExpr(ident"req", ident"ip")
Expand Down

0 comments on commit 4952817

Please sign in to comment.