-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [Bug]: version v2.52.2 up to v2.52.3 , cors error #2936
Comments
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
I am getting the same issue after upgrading to Just spent the last 3 hours scratching my head and re-evaluating my life choices only to realise it was an error in the package itself 😅 |
We are affected with the same issue, after a rollback to 2.5.2 it works again. |
@LKaemmerling @bytesizedwizard just to make sure you mean the last release can you give us the cors error so that we can fix it as soon as possible app.Use(cors.New(cors.Config{
AllowOriginsFunc: func(origin string) bool {
// request origin is important for us
log.Println("request origin", origin)
for _, c := range config.Get[[]string]("cors") {
// your origin is important for us
log.Println("match origin", c)
if c == origin {
return true
}
}
return false
},
})) |
@sixcolors FYI |
@ReneWerner87 yes, sorry of course i was talking about 2.52.3. What i can see is that not a single CORS header is added to the response, so regardless of what we configure. |
@sixcolors we should also include the case of the consumers in our unittests so that this no longer happens and also the response headers of the old and new version |
@ReneWerner87 we don't use the function directly, we simply configure the middleware with the following values:
|
@LKaemmerling can you give the request origin and also the response headers in the old and new versions for you we need the possibility to recreate the problem on our site in order to correct it it is also good to know that you are not using the function, then it probably has something to do with the following process |
@ReneWerner87 working (with 2.52.2):
Broken: (v2.52.3) Req is the same
So you can see that the CORS headers are missing. |
@sixcolors this is the problem the second condition Line 174 in 7ba02c1
|
believe this check should only be added to the options request and not to the actual request of the action |
we could confirm that our new logic, which is closer to the standard, is unfortunately not decapsulated and also affects the non-preflight request we will adjust this by the end of the day or tomorrow morning and then release in a timely manner until then I would suggest skipping the last release |
@febelery @LKaemmerling and @bytesizedwizard are you able to verify if #2937 fixes CORS in your dev envs? |
@LKaemmerling @febelery @bytesizedwizard can you pls briefly check if everything fits with the following commit before I release and tag it go.mod
|
@ReneWerner87 @sixcolors thank you a lot! With your recent changes (`v2.52.4-0.20240326212242-a6f4c133bc74) i can confirm it now works again as we would expect it. |
thanks, but wait until the other two confirm, then I will release |
Can this be forward ported to v3? Should I open an issue for v3 and post the repro app code? |
solved with v2.52.4
we will do this |
@ReneWerner87 #2938 is the v3 fix. However @LKaemmerling i would caution against using v3 at this time. It’s still under active development and is not stable. Okay to play with. But would not use in production. |
Bug Description
version v2.52.2 up to v2.52.3 , cors error
version v2.52.2 is correct
How to Reproduce
Steps to reproduce the behavior:
Expected Behavior
cors correct
Fiber Version
v2.52.3
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: