swlib / saber

⚔️ Saber, PHP异步协程HTTP客户端 | PHP Coroutine HTTP client - Swoole Humanization Library
https://packagist.org/packages/swlib/saber
Apache License 2.0
978 stars 124 forks source link

Cookie parseHeader方法解析cookie需要增加容错 #138

Open ppanphper opened 3 years ago

ppanphper commented 3 years ago

image

$kvs = explode(';', $header); // 需要去除";"后的空格,因为有些服务设置cookie没有在分号后追加空格

$cookie['value'] = str_replace(['\'\'', '""'], '', trim($nv[1])); // 去除首位空格

$kv = explode('=', trim($kv)); // 同上

sy-records commented 3 years ago

欢迎PR