Return 403 in filter's responseError()

This commit is contained in:
Yang Luo 2023-10-05 00:12:02 +08:00
parent d0c424db0a
commit 2fd2d88d20

View File

@ -16,6 +16,7 @@ package routers
import (
"fmt"
"net/http"
"strings"
"github.com/beego/beego/context"
@ -33,6 +34,8 @@ type Response struct {
}
func responseError(ctx *context.Context, error string, data ...interface{}) {
ctx.ResponseWriter.WriteHeader(http.StatusForbidden)
resp := Response{Status: "error", Msg: error}
switch len(data) {
case 2: