mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-18 13:51:50 +01:00
Fixes TestRequest::with_cookie panic
This commit is contained in:
parent
346d85a884
commit
b018e4abaf
@ -558,7 +558,7 @@ impl<S: 'static> TestRequest<S> {
|
|||||||
|
|
||||||
/// set cookie of this request
|
/// set cookie of this request
|
||||||
pub fn cookie(mut self, cookie: Cookie<'static>) -> Self {
|
pub fn cookie(mut self, cookie: Cookie<'static>) -> Self {
|
||||||
if self.cookies.is_none() {
|
if self.cookies.is_some() {
|
||||||
let mut should_insert = true;
|
let mut should_insert = true;
|
||||||
let old_cookies = self.cookies.as_mut().unwrap();
|
let old_cookies = self.cookies.as_mut().unwrap();
|
||||||
for old_cookie in old_cookies.iter() {
|
for old_cookie in old_cookies.iter() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user