diff --git a/src/helpers.nim b/src/helpers.nim index 177c21a..64a0336 100644 --- a/src/helpers.nim +++ b/src/helpers.nim @@ -1,3 +1,5 @@ +import std/httpcore + template H*(s: string): untyped = $request.headers[s] @@ -8,3 +10,7 @@ template reqInfo*: string = template respErr*(s: string): untyped = error s & reqInfo resp Http403, s + +template respErr*(e: HttpCode, s: string): untyped = + error s & reqInfo + resp e, s