iris-contrib / iris-contrib/middleware
cors should Change the way
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 239
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
I have try the middleware,but it does not work
I find an easy way to handle this,maybe you can change
I copy from https://studygolang.com/articles/25389
crs := cors.New(cors.Options{
AllowedOrigins: []string{"*"}, // allows everything, use that to change the hosts.
AllowCredentials: true,
})
app:= iris.New()
app.Use(crs())
unlike
crs := cors.New(cors.Options{
AllowedOrigins: []string{"*"}, // allows everything, use that to change the hosts.
AllowCredentials: true,
})
v1 := app.Party("/api/v1", crs).AllowMethods(iris.MethodOptions)`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported behavior with the two CORS configurations shown in the issue: app.Use(crs()) and app.Party("/api/v1", crs).AllowMethods(iris.MethodOptions). Trace the middleware and route setup to determine the expected handling of CORS and OPTIONS requests. Done means the documented configuration works consistently without weakening the stated origin or credential behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100