From 83a8214119eccb39f4c38e7b1ae54daebdeb0184 Mon Sep 17 00:00:00 2001 From: Melonai Date: Mon, 26 Jul 2021 22:37:37 +0200 Subject: Prefer high-level RequestCtx functions over low-level ones --- handlers/portgate.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'handlers/portgate.go') diff --git a/handlers/portgate.go b/handlers/portgate.go index 1cd9bb8..f53f3c9 100644 --- a/handlers/portgate.go +++ b/handlers/portgate.go @@ -2,7 +2,6 @@ package handlers import ( "github.com/valyala/fasthttp" - "net/http" "portgate" ) @@ -37,8 +36,7 @@ func (h *RequestHandler) handlePortgatePageRequest(ctx *fasthttp.RequestCtx) { ctx.Response.Header.SetContentType("text/html") err := h.templates.ExecuteTemplate(ctx, "authenticate.template.html", nil) if err != nil { - ctx.SetStatusCode(http.StatusInternalServerError) - _, _ = ctx.WriteString("An error occurred.") + h.handleError(ctx) } } -- cgit 1.4.1