Commit Graph

51 Commits

Author SHA1 Message Date
Konstantin Podshumok e6a32d6283 preserve python2-like dict API for RequestCookieJar 2013-12-18 18:09:24 +04:00
Konstantin Podshumok 537def4a4f fix regression with cookiejar.iteritems() 2013-12-18 06:56:53 +04:00
Michael Becker ea4570da57 cookies: Fix bugs found during CI 2013-12-06 09:02:45 -05:00
Michael Becker ef5875cc19 cookies: Take a less cowardly approach
Per discussion with @sigmavirus24, we'll take the less cowardly approach here.
"the RFC defines the Expires header as a string with the format we're assigning to ``time_template`` so checking if it is a string is unnecessary."

Crossing my fingers that this doesn't break anyones existing code...
2013-12-06 09:02:45 -05:00
Michael Becker 6140d08241 cookies: Replace type checks with try/except 2013-12-06 08:56:30 -05:00
daftshady 8eb40c777e remove unnecessary try 2013-11-26 15:28:59 +09:00
daftshady 8b2255d0f8 double try statement 2013-11-26 15:28:59 +09:00
daftshady 5fcaf45c33 update 'merge_cookies' not to create new instance. 2013-11-26 15:28:59 +09:00
daftshady 1adba3c9e9 modified 'merge_cookies' and update tests.
made sessions.py to use that method when merging cookies.
2013-11-26 15:28:59 +09:00
daftshady 30018e604c update 'merge_cookies' 2013-11-26 15:28:59 +09:00
daftshady e40c1637c9 added new method 'merge_cookies' and use it when merging session cookies with param cookies. 2013-11-26 15:28:59 +09:00
nonm cfbbd15de7 Small fix broken cookie parse 2013-11-18 13:32:59 -08:00
kennethreitz a123f8351d Merge pull request #1660 from sigmavirus24/parse-cookies-when-users-set-host-header
Parse cookies when users set custom Host header
2013-11-06 11:19:31 -08:00
Ian Cordasco 6632fb87c0 Fix typo 2013-10-11 20:42:52 -05:00
Ian Cordasco df7aece2c8 Comment our reasonsing for the special cases 2013-10-10 20:43:18 -05:00
Ian Cordasco 0bb8be0e5b Parse cookies when users set custom Host header 2013-10-07 21:43:21 -05:00
daftshady 012f0334ce added param to cookiejar_from_dict instead of creating new method. 2013-09-29 01:08:58 +09:00
daftshady d22eaf96e2 Fixed #1630 2013-09-28 23:44:27 +09:00
Ian Cordasco 98680b64f4 Skip cookie extraction if necessary
If _original_response is never set/is None, then don't try to extract cookies
from the response.
2013-08-16 21:38:20 -05:00
Cory Benfield 6ef3710970 Provide 'host' parameter to MockRequest. 2013-07-30 18:21:37 +01:00
Flavio Curella a8cf5b8502 keep the double quotes, but don't escape them 2013-07-01 15:48:48 -05:00
Flavio Curella cdab4fabf4 unquote double-quotes cookie values 2013-07-01 13:51:40 -05:00
wasw100 767f758aac cookies.morsel_to_cookie morsel['expires'] can't be strtime, and max-age convert to expires problem repair 2013-06-07 00:02:45 +08:00
wasw100 961790f95c cookies.morsel_to_cookie(morsel) raise TypeError repaired.
morsel_to_cookie(mosel) method raise TypeError: create_cookie() got unexpected keyword arguments: ['path_specified', 'domain_specified', 'port_specified', 'domain_initial_dot'].

so we should remove these param from create_cookie(...)
2013-06-06 19:15:09 +08:00
Ian Cordasco 9ce7f0bf5b Attempt a fix for @michaelhelmick 2013-05-20 10:58:03 -04:00
Chase Sterling 3f86e22a07 Make sure session cookies do not overwrite explicit request cookies
Implement RequestsCookieJar.copy
Use RequestsCookieJar.update when merging cookiejars
2013-02-16 00:56:59 -05:00
Chase Sterling f3393fb24c Remove ability to from RequestCookieJar __getitem__, __setitem__ to use cookies as keys 2013-02-14 22:52:31 -05:00
Chase Sterling 87d9d9643c Allow RequestsCookieJar to be updated with cookies from a CookieJar 2013-02-14 01:05:42 -05:00
Ian Cordasco 2e31696156 Test and perfection for cookie handling.
I also fixed up some of the RequestsCookieJar methods so using
jar.update(other_jar) works without a problem. This cleans up some of the code
in sessions and the resolve_redirects method.
2013-02-10 19:36:36 -05:00
Kenneth Reitz 4bad1285b6 nice and cleanup 2012-12-17 05:47:41 -05:00
Kenneth Reitz 4a01272fb3 cleanup 2012-12-17 01:25:55 -05:00
Kenneth Reitz ab27027aa8 cookies 2012-12-15 04:33:44 -05:00
Cory Benfield b76326bf94 MockRequest needs a type property for Py3.3 2012-11-17 13:00:39 +00:00
Radu Voicilas 820dfb0495 Making the code more PEP8 compliant 2012-10-09 00:42:49 +03:00
tokuda109 5ec2c96f02 declare the encoding 2012-10-09 00:42:49 +03:00
yegle 22fdecba52 Update: @property decorator instead of __getattr__ 2012-10-09 00:42:48 +03:00
yegle e656222188 Python 3.3 compatible update
httplib.cookiejar.DefaultCookiePolicy changed its implementation of
set_ok_verifiability.
2012-10-09 00:42:48 +03:00
Locker537 42d0a2169e Whitespace fixes following PEP8. 2012-08-16 17:38:35 -04:00
ig0774 98b8316c0c Send the original response url to urlparse rather than the Response object. urlparse cannot handle Response objects. 2012-06-08 09:35:54 -03:00
Josh Imhoff 0eb0b89431 Removed print statements left over from debugging. 2012-05-21 20:27:47 -04:00
Josh Imhoff 96cd8e9ca0 Wrote tests for new CookieJar functionality and made them pass. 2012-05-21 20:14:12 -04:00
Josh Imhoff 9f26d0ced3 In cookies.py, CookieConflictError is now thrown if there is more than one cookie with same name. 2012-05-21 18:21:12 -04:00
Josh Imhoff b7d0925d6b Docstrings and bug fixes in cookies.py 2012-05-21 17:59:38 -04:00
Josh Imhoff 686db5d452 Defined keys(), values(), and items() in order to support dict-like client interface. Now, we throw exceptions if __getitem__() or __setitem__() is used when multiple domains are in jar. 2012-05-18 00:48:59 -04:00
Kenneth Reitz 0a37d82444 Merge pull request #603 from benmao/develop
get cookie like dict, such as s.cookies.get('test', 'no cookie')
2012-05-10 11:07:00 -07:00
ben 44663b5e8e get cookie like dict, such as self.cookies.get('test', 'no cookie') 2012-05-10 22:17:23 +08:00
Josh Imhoff cff70e75b7 New implementation of safe_mode. Now, we throw exceptions in models.py regardless of safe_mode. We catch those exceptions at the API level and return a blank Response. See safe_mode.py for details. 2012-05-09 14:47:29 -04:00
Shivaram Lingamneni 11a3eaec26 add Python 3 compatibility 2012-05-01 17:00:19 -07:00
Shivaram Lingamneni 404ecaf95b clarified documentation from e-mail discussion 2012-05-01 17:00:19 -07:00
Shivaram Lingamneni 1de14e6a93 fix usage of compat.urlparse
(this code path appears to have been exercised only by secure cookies)
2012-05-01 17:00:19 -07:00