-
Notifications
You must be signed in to change notification settings - Fork 321
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
Cookies are set multiple times when using *server.nest* #396
Comments
@isgj thanks for the bug report! I suspect this is because each instance of I see two ways of fixing this:
I'm thinking the better solution here would be the second one. Because it would allow us to prevent future issues when we enable other middleware by default (e.g. ImplementationI think the way to fix this is to remove this: Lines 206 to 208 in 4e2857a
And instead add it back inside Lines 308 to 310 in 4e2857a
The default middleware should probably be pushed to the start of the middleware vector though, so that logging, cookies, etc. all run in a predetermined order before any userland middleware. cc/ @tirr-c |
Fixes http-rs#396 by ensuring the cookies and log middleware is only created when we actually call .listen and not when nested. This change adds a public `into_mock` method to Server so that an instance with the cookie and log middleware can be crated from the tests.
Fixes http-rs#396 by ensuring the cookies and log middleware is only created when we actually call .listen and not when nested. This change adds a public `into_mock` method to Server so that an instance with the cookie and log middleware can be crated from the tests.
Fixes http-rs#396 by ensuring the cookies and log middleware is only created when we actually call .listen and not when nested. This change adds a public `into_mock` method to Server so that an instance with the cookie and log middleware can be crated from the tests.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies middlewares from `Server::with_state()` and allows users to use their own middlewares, or use the default ones from the framework by calling `with_cookies()` and/or `with_logging()` on the server instance.
When setting a cookie in a nested service it is set multiple times depending on the level of the nested service. For example:
When
GET localhost:8080/1/2/3
the response isThe cookie is set 3 times.
The text was updated successfully, but these errors were encountered: