popomore / koa-proxy

Proxy middleware for koa
223 stars 102 forks source link

cookie默认被缓存 #39

Closed stoneChen closed 7 years ago

stoneChen commented 8 years ago

使用过程中发现莫名其妙的cookie问题,甚至都怀疑浏览器有bug了囧 调试了好久,原来有一个默认选项jar是true:

var request = coRequest.defaults({ jar: typeof options.jar === 'undefined' ? true : options.jar });

一开始不知道什么鬼,后来一层层看进去,最终在request模块里找到这个配置项https://github.com/request/request#requestoptions-callback 如果为true,则会缓存cookie 不知为何本模块要把这个jar选项默认为true,至少文档里提一下有jar这个配置吧