-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Have I found a bug in BodyParser, or am I an idiot? #2918
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 |
This is because by default, you cannot keep references to request data beyond the scope of the handler. What you're seeing is that the underlying buffer of the string is reused between requests. You can get around this two ways:
|
Thank you @nickajacks1 and @gaby |
Question Description
I am new to Fiber so please forgive me is this is a noob issue, but I can't understand what is going wrong with my Fiber app code.
I am trying to achieve the following:
When I add the first record things work as expected:
When I add a second record, the value in the first record is changed/corrupted.
I didn't expect that. I expected the first item to have a value of 1 and the second record to have a value of 2..
Here's what happens when more items are added.
At this point the collection should be
[{Value:1} {Value:2} {Value:3} {Value:abc}]
What am I doing wrong?
Code Snippet (optional)
No response
Checklist:
The text was updated successfully, but these errors were encountered: