1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-01 22:11:20 +00:00

Fixes TestRequest::with_cookie panic

This commit is contained in:
Jason Hills 2019-02-06 14:37:43 -07:00 committed by Douman
parent 346d85a884
commit b018e4abaf

View file

@ -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() {