From 2c462b3481511154e16f6e3b39d7b1b04d4575e5 Mon Sep 17 00:00:00 2001 From: "manu.somolinos" Date: Wed, 1 Sep 2021 16:24:19 +0200 Subject: [PATCH] new function to return forbidden --- errors/errors.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/errors/errors.go b/errors/errors.go index e33fdad..b455414 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -24,6 +24,10 @@ func ToUnauthorizedResponse(event events.APIGatewayV2HTTPRequest) events.APIGate return ToResponseVoid(http.StatusUnauthorized) } +func ToForbiddenResponse(event events.APIGatewayV2HTTPRequest) events.APIGatewayV2HTTPResponse { + return ToResponseVoid(http.StatusForbidden) +} + func ToNotFoundResponse(event events.APIGatewayV2HTTPRequest, message string) events.APIGatewayV2HTTPResponse { return ToResponseWithBody(event, http.StatusNotFound, message) }