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
While writing tests against endpoints that need authentication I need to add a cookie header with the session id. Is there a way to obtain the header value from a cookie jar?
let jar = SignedCookieCookieJar::new();// let session_id = "...";// jar.add(Cookie::new("sid", session_id));// ... let req = Request::builder().method("GET").uri("/admin").header("Cookie", jar...).unwrap();let res = app.oneshot(req).await.unwrap();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
While writing tests against endpoints that need authentication I need to add a cookie header with the session id. Is there a way to obtain the header value from a cookie jar?
axum version
axum: 0.8.1, axum-extra: 0.10.0
Beta Was this translation helpful? Give feedback.
All reactions