This commit is contained in:
crusader 2018-04-11 20:34:45 +09:00
parent e7d766bf07
commit 5154784254

View File

@ -138,10 +138,15 @@ func (s *Server) httpHandler(ctx *fasthttp.RequestCtx) {
servlet Servlet
)
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
}
servletCtx := servlet.ServletCtx(s.ctx)
if err := servlet.Handle(servletCtx, ctx); nil != err {