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:
parent
346d85a884
commit
b018e4abaf
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue