Skip to content

[Notice] Preflight with no origin will return OPTIONS 404 #86

@fghpdf

Description

@fghpdf

Now you can see there is no [Origin] in my OPTIONS Request
image

And At Here

cors/config.go

Lines 58 to 62 in 5f50d4f

origin := c.Request.Header.Get("Origin")
if len(origin) == 0 {
// request is not a CORS request
return
}

The code will return and do nothing. Will Not Return Headers.

So If you not define OPTIONS Router, you will get 404 immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions