Skip to content

Commit

Permalink
使用Cors组件时,插入到中间件第一个
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Nov 11, 2023
1 parent 4fe15a6 commit 5ebee9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion applicationBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (r *applicationBuilder) Area(area string, f func()) {

// UseCors 使用CORS中间件
func (r *applicationBuilder) UseCors() {
r.RegisterMiddleware(&middleware.Cors{})
r.MiddlewareList.Insert(0, &middleware.Cors{})
}

// UseStaticFiles 支持静态目录,在根目录./wwwroot中的文件,直接以静态文件提供服务
Expand Down

0 comments on commit 5ebee9f

Please sign in to comment.