mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
log error and respond + request info
This commit is contained in:
parent
f1ee45bd8b
commit
6df0899491
1 changed files with 8 additions and 0 deletions
|
@ -1,2 +1,10 @@
|
||||||
template H*(s: string): untyped =
|
template H*(s: string): untyped =
|
||||||
$request.headers[s]
|
$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
|
||||||
|
|
Loading…
Add table
Reference in a new issue