mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Return 403 in filter's responseError()
This commit is contained in:
parent
d0c424db0a
commit
2fd2d88d20
@ -16,6 +16,7 @@ package routers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/beego/context"
|
"github.com/beego/beego/context"
|
||||||
@ -33,6 +34,8 @@ type Response struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func responseError(ctx *context.Context, error string, data ...interface{}) {
|
func responseError(ctx *context.Context, error string, data ...interface{}) {
|
||||||
|
ctx.ResponseWriter.WriteHeader(http.StatusForbidden)
|
||||||
|
|
||||||
resp := Response{Status: "error", Msg: error}
|
resp := Response{Status: "error", Msg: error}
|
||||||
switch len(data) {
|
switch len(data) {
|
||||||
case 2:
|
case 2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user