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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user