[issue25635] urllib2 cannot fully read FTP file

2015-11-16 Thread keakon
New submission from keakon: I found the bug from this slide: http://sector.ca/Portals/17/Presentations15/SecTor_Branca.pdf The second way cannot fully read the file. import urllib2 url = 'ftp://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest' response = urllib2.u

[issue17340] Handle malformed cookie

2013-03-08 Thread keakon
keakon added the comment: karl, I don't know the exact reason. "BRIDGE_R" is a cookie name set by Baidu Bridge. I don't know why there is a comma before it. The Baidu Bridge is an external JavaScript resource. It can do anything like: document.cookie = ",BRIDGE_R=;&q

[issue17340] Handle malformed cookie

2013-03-08 Thread keakon
keakon added the comment: Terry, I think that's the standard process of web applications. 1. The user agent send cookie via HTTP headers to the web server. 2. The web server parse its cookie. If the server fails to find something proves the user has logged in from his cookie, redirect h

[issue17340] Handle malformed cookie

2013-03-08 Thread keakon
keakon added the comment: Terry, say that a user's cookie is ",BRIDGE_R=; a=b;" right now. When he login, the server sends "Set-Cookie: user_id=1; Path=/" header to him. Then his cookie is ",BRIDGE_R=; a=b; user_id=1;" now. The next time he sends cookie to t

[issue17340] Handle malformed cookie

2013-03-03 Thread keakon
New submission from keakon: One of my user told me that she couldn't login to my website yesterday. I logged her cookie, and found it began with ',BRIDGE_R=;' which was a malformed cookie. Tornado uses Cookie.SimpleCookie.load() to parse her cookie, and returns an empty dict w