1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 06:40:40 +00:00

Refactoring: Move dev & prod runmodes to const

This commit is contained in:
Vitaly Velikodny
2015-12-29 21:32:37 +03:00
parent ac3a447479
commit 48fd9675ad
11 changed files with 33 additions and 21 deletions

View File

@ -220,7 +220,7 @@ func Test_Preflight(t *testing.T) {
func Benchmark_WithoutCORS(b *testing.B) {
recorder := httptest.NewRecorder()
handler := beego.NewControllerRegister()
beego.BConfig.RunMode = "prod"
beego.BConfig.RunMode = beego.PROD
handler.Any("/foo", func(ctx *context.Context) {
ctx.Output.SetStatus(500)
})
@ -234,7 +234,7 @@ func Benchmark_WithoutCORS(b *testing.B) {
func Benchmark_WithCORS(b *testing.B) {
recorder := httptest.NewRecorder()
handler := beego.NewControllerRegister()
beego.BConfig.RunMode = "prod"
beego.BConfig.RunMode = beego.PROD
handler.InsertFilter("*", beego.BeforeRouter, Allow(&Options{
AllowAllOrigins: true,
AllowCredentials: true,