ing
This commit is contained in:
parent
5154784254
commit
42d71182fc
|
@ -138,6 +138,11 @@ func (s *Server) httpHandler(ctx *fasthttp.RequestCtx) {
|
|||
servlet Servlet
|
||||
)
|
||||
|
||||
if !s.ServerHandler.CheckOrigin(ctx) {
|
||||
s.onError(ctx, web.NewError(fasthttp.StatusForbidden, fmt.Errorf("Forbidden")))
|
||||
return
|
||||
}
|
||||
|
||||
if string(ctx.Method()) == "OPTIONS" && ctx.Request.Header.Peek("Access-Control-Request-Method") != nil {
|
||||
ctx.SetStatusCode(fasthttp.StatusOK)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user