1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

Nothing special(2): remaining linting

This commit is contained in:
Makis Maropoulos
2016-06-03 05:20:27 +03:00
parent a337b4768d
commit a3f3e7ebd2
4 changed files with 13 additions and 15 deletions

View File

@@ -228,7 +228,7 @@ func (c *Cors) Conflicts() string {
// Serve serves the middleware
func (c *Cors) Serve(ctx *iris.Context) {
if ctx.MethodString() == "OPTIONS" {
if ctx.MethodString() == iris.MethodOptions {
c.logf("Serve: Preflight request")
c.handlePreflight(ctx)
// Preflight requests are standalone and should stop the chain as some other
@@ -249,7 +249,7 @@ func (c *Cors) Serve(ctx *iris.Context) {
func (c *Cors) handlePreflight(ctx *iris.Context) {
origin := ctx.RequestHeader("Origin")
if ctx.MethodString() != "OPTIONS" {
if ctx.MethodString() != iris.MethodOptions {
c.logf(" Preflight aborted: %s!=OPTIONS", ctx.MethodString())
return
}