Closed duduchristian closed 1 year ago
refer to
VERY IMPORTANT! Fasthttp disallows holding references to [RequestCtx](https://pkg.go.dev/github.com/valyala/fasthttp#RequestCtx) or to its' members after returning from [RequestHandler](https://pkg.go.dev/github.com/valyala/fasthttp#RequestHandler). Otherwise [data races](http://go.dev/blog/race-detector) are inevitable. Carefully inspect all the net/http request handlers converted to fasthttp whether they retain references to RequestCtx or to its' members after returning.
in https://github.com/valyala/fasthttp#switching-from-nethttp-to-fasthttp
Senario:
Call /test/param1 and /test/abc respectively for several times, you can see there are entries in m like abcam1. I think the problem is caused by the b2s function in request.go which makes the params obtained by gin in different calls pointing to the same byte slice: https://github.com/valyala/fasthttp/blob/2ab79063af85601f532e85c3071c7f993b92fba5/fasthttpadaptor/request.go#L69-L72