From a1232c9a9a259849fa455867ca509d3422087b3d Mon Sep 17 00:00:00 2001 From: Gerasimos Maropoulos <kataras2006@hotmail.com> Date: Fri, 23 Feb 2018 04:25:12 +0200 Subject: [PATCH] _examples: replace DELETE string with iris.MethodDelete, for important changes see: https://github.com/kataras/iris/pull/909 and https://github.com/kataras/iris/commit/6de64d517e7a65cb0c4f4d832ce12e792de0bb55 [formerly 35dd2ab80b69a5bea6f35f58e636bc11229d9921] Former-commit-id: d0f5785aff289b8c140e4f253eb555135e79603d --- _examples/experimental-handlers/cors/simple/main.go | 3 --- _examples/routing/fallback-handlers/main.go | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/_examples/experimental-handlers/cors/simple/main.go b/_examples/experimental-handlers/cors/simple/main.go index 94593b08..c149044a 100644 --- a/_examples/experimental-handlers/cors/simple/main.go +++ b/_examples/experimental-handlers/cors/simple/main.go @@ -5,19 +5,16 @@ package main import ( "github.com/kataras/iris" - "github.com/kataras/iris/core/router" "github.com/iris-contrib/middleware/cors" ) func main() { - app := iris.New() // `crs := cors.NewAllowAllPartyMiddleware()`, or: crs := cors.NewPartyMiddleware(cors.Options{ AllowedOrigins: []string{"*"}, // allows everything, use that to change the hosts. - AllowedMethods: router.AllMethods[:], AllowCredentials: true, }) diff --git a/_examples/routing/fallback-handlers/main.go b/_examples/routing/fallback-handlers/main.go index 72a07d14..e9e6b2ec 100644 --- a/_examples/routing/fallback-handlers/main.go +++ b/_examples/routing/fallback-handlers/main.go @@ -17,7 +17,7 @@ func h(ctx iris.Context) { } func fallbackHandler(ctx iris.Context) { - if ctx.Method() == "DELETE" { + if ctx.Method() == iris.MethodDelete { ctx.NextOrNotFound() return }