popomore / koa-proxy

Proxy middleware for koa
223 stars 102 forks source link

cookie默认被缓存 #40

Closed stoneChen closed 7 years ago

stoneChen commented 8 years ago

很赞的koa代理模块! 使用过程中发现莫名其妙的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这个配置吧

quex46 commented 8 years ago

agree. options.jar must be false by default or documented. otherwise it causes a big problem. in our case we had unlogged users to see confidential data about others (because of cached jar from previous requests) until we had to look under the hood of this module

kitze commented 8 years ago

Damn, thank you for this comment, it was a lifesaver!