Issue with Setting Cookies in Middleware Using HttpServerResponse.unsafeSetCookies
Hi everyone.
I'm trying to write a middleware to convert responses into standard format. I need to set
I used
How should I use this function.
Also why the
Here is my middleware:
I'm trying to write a middleware to convert responses into standard format. I need to set
Cookies using HttpServerResponse.unsafeSetCookies but for some reason the cookies variable inside HttpServerResponse in appendPreResponseHandler is not compatible with the required type.I used
Iterator, Iterable, tried to make my own but nothing worked. How should I use this function.
Also why the
cookies or cookies.cookies is not compatible in the first place, like it should be easy as HttpServerResponse.json({}).pip(HttpServerResponse.unsafeSetCookies(res.cookies.cookies)).Here is my middleware:
