log error and respond + request info

This commit is contained in:
array-in-a-matrix 2024-08-12 14:40:44 -04:00
parent f1ee45bd8b
commit 6df0899491

View file

@ -1,2 +1,10 @@
template H*(s: string): untyped =
$request.headers[s]
template reqInfo*: string =
$request.reqMethod & " " & request.host & request.path & " " & request.ip &
" " & $request.headers["user-agent"]
template respErr*(s: string): untyped =
error s & reqInfo
resp Http403, s