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 encountered a strange problem when using the middleware of fiber, a downstream software that depends on fasthttp. I think this problem may be related to fasthttp.
To better illustrate this problem, I added a test for fasthttp to simulate the process of fiber using middleware. As a result, this test failed and reported an error in line 177:
As I mentioned in the code comments, this test can pass as long as line 172 is commented out, but line 172 is not related to cookies, which indicates that fasthttp may have experienced improper memory reuse in it.
I think there are two possible directions of the solution:
Fix the improper memory reuse problem in fasthttp. I have basically located the code that causes this problem. If you are sure that this is indeed a bug, I am happy to submit a PR to fix this problem.
Confirm that the way to use middleware in fiber is inappropriate. Since the fiber implementation ignores ResponseWriter and r in the middleware and restarts from ctx, this may be inappropriate. If you are sure that this is the reason for the error, I will try to communicate with the fiber developers.
Thank you for your attention! If you have any questions or would like to discuss further with me, please feel free to contact me.
Best wishes.
The text was updated successfully, but these errors were encountered:
Hi developers,
I encountered a strange problem when using the middleware of fiber, a downstream software that depends on fasthttp. I think this problem may be related to fasthttp.
To better illustrate this problem, I added a test for fasthttp to simulate the process of fiber using middleware. As a result, this test failed and reported an error in line 177:
https://github.com/sigmundxia/fasthttp/blob/a165213f6370f59e5d6414f4f573eb6519c472ca/fasthttpadaptor/adaptor_test.go#L142-L187
As I mentioned in the code comments, this test can pass as long as line 172 is commented out, but line 172 is not related to cookies, which indicates that fasthttp may have experienced improper memory reuse in it.
I think there are two possible directions of the solution:
Fix the improper memory reuse problem in fasthttp. I have basically located the code that causes this problem. If you are sure that this is indeed a bug, I am happy to submit a PR to fix this problem.
Confirm that the way to use middleware in fiber is inappropriate. Since the fiber implementation ignores
ResponseWriter
andr
in the middleware and restarts fromctx
, this may be inappropriate. If you are sure that this is the reason for the error, I will try to communicate with the fiber developers.Thank you for your attention! If you have any questions or would like to discuss further with me, please feel free to contact me.
Best wishes.
The text was updated successfully, but these errors were encountered: