changeset 83:d521df55f56c

fix pinlib cookie parsing and check in pics app
author paulo
date Wed, 29 Jun 2016 00:48:53 -0700
parents d7d67887102f
children 03c6971ed023
files pics2/pics_app.py pinlib/pinlib.py
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/pics2/pics_app.py	Wed Jun 29 00:11:55 2016 -0700
     1.2 +++ b/pics2/pics_app.py	Wed Jun 29 00:48:53 2016 -0700
     1.3 @@ -142,7 +142,11 @@
     1.4  	
     1.5  		self._qs = urlparse.parse_qs(self._environ["QUERY_STRING"])
     1.6  		logging.debug("self._qs = %s" % self._qs)
     1.7 -		if pinlib.PinMan("lahat").check(pinlib.parse_cookies(self._environ)):
     1.8 +		try:
     1.9 +			pinlib.PinMan("lahat").check(pinlib.parse_cookies(self._environ))
    1.10 +		except pinlib.PinFailError:
    1.11 +			pass
    1.12 +		else:
    1.13  			self._show_index = True
    1.14  
    1.15  		if len(ppi) >= 2 and _is_pics_dir(ppi[1]):
     2.1 --- a/pinlib/pinlib.py	Wed Jun 29 00:11:55 2016 -0700
     2.2 +++ b/pinlib/pinlib.py	Wed Jun 29 00:48:53 2016 -0700
     2.3 @@ -2,7 +2,7 @@
     2.4  
     2.5  
     2.6  def parse_cookies(environ):
     2.7 -	return urlparse.parse_qs(environ.get("HTTP_COOKIE", ""))
     2.8 +	return urlparse.parse_qs(environ.get("HTTP_COOKIE", "").replace("; ", "&"))
     2.9  
    2.10  
    2.11  class PinFailError(Exception):