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