diff --git a/client/src/lib.rs b/client/src/lib.rs index 05b4677..8a8addc 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -415,15 +415,10 @@ impl WsTcp { if let Ok(jv) = Reflect::get(&raw_headers, &jval!(k.to_string())) { if jv.is_array() { let arr = Array::from(&jv); - arr.push(&jval!(v.to_str().unwrap().to_string())); - let _ = Reflect::set(&raw_headers, &jval!(k.to_string()), &arr); - } else if !jv.is_falsy() { - let arr = Array::new(); - arr.push(&jv); - arr.push(&jval!(v.to_str().unwrap().to_string())); - let _ = Reflect::set(&raw_headers, &jval!(k.to_string()), &arr); - } else { + arr.push(&jval!(v.to_str()?.to_string())); + let _ = Reflect::set(&raw_headers, &jval!(k.to_string()), &arr); + } else if jv.is_truthy() { let _ = Reflect::set( &raw_headers, &jval!(k.to_string()),