John J Lee <jj...@users.sourceforge.net> added the comment:

It looks to me that it's just request_path that's wrong, so no need to add 
extra arguments to that function.  It should discard the query and fragment 
(still keeping the "parameters" -- using urlparse.urlsplit instead of 
urlparse.urlparse would make that simpler).

request_path is only called in three places:

 * We're agreed that the default cookie path should omit the query (and 
fragment)
 * Netscape cookies aren't checked for path on setting cookies 
(.set_ok_path()), so the value of request_path isn't checked in that case
 * Netscape cookies are checked for path on returning cookies, but including 
the query & fragment will never make a difference to the .startswith check in 
.path_return_ok()

Finally, even RFC 2965, which nobody cares about, and which does include the 
path check on setting the cookie, refers to RFC 2396 for the definition of 
request-URI, and both RFC 2396 and RFC 3986, which obsoletes it, agree that the 
path doesn't include the query (nor the fragment).

Incidentally: the request_path function docstring claims to return the 
request-URI, but obviously the docstring should say it returns the path 
component of the request-URI.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3704>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to