diff options
| author | Melonai <einebeere@gmail.com> | 2021-07-26 22:37:37 +0200 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2021-07-26 22:37:37 +0200 |
| commit | 83a8214119eccb39f4c38e7b1ae54daebdeb0184 (patch) | |
| tree | 064be9c76e295985634718cb290d8acb1cd2dada /handlers/portgate.go | |
| parent | 0ac82c133b78a14239beb9034380c44d95d4bad3 (diff) | |
| download | portgate-83a8214119eccb39f4c38e7b1ae54daebdeb0184.tar.zst portgate-83a8214119eccb39f4c38e7b1ae54daebdeb0184.zip | |
Prefer high-level RequestCtx functions over low-level ones
Diffstat (limited to 'handlers/portgate.go')
| -rw-r--r-- | handlers/portgate.go | 4 |
1 files changed, 1 insertions, 3 deletions
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) } } |
