You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed some strange behavior during implementing a middleware.
If I create a variable in middleware scope which holds request method and then pass the variable to a goroutine method := ctx.Method()
The variable can be modified if there is parallel request.
In my case I got strange value "GETT" when I expect "POST"
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
Bug Description
I noticed some strange behavior during implementing a middleware.
If I create a variable in middleware scope which holds request method and then pass the variable to a goroutine
method := ctx.Method()
The variable can be modified if there is parallel request.
In my case I got strange value "GETT" when I expect "POST"
How to Reproduce
I prepared small program to reproduce the issue here https://go.dev/play/p/u4BlH1khRTG
or here https://github.com/maxwww/fibertmp/blob/main/main.go
Just run the program
go run main.go
Expected Behavior
I expect to see correct value of variable
ER: "POST"
AR: "GETT"
Fiber Version
v2.52.2
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: