Commits

Jason R. Coombs committed 7b5e567

Fix issue where non-specification of max-age was treated as max-age=0

  • Participants
  • Parent commits 6f705f3

Comments (0)

Files changed (1)

File jaraco/net/http/caching.py

 		return self.fresh() and not self.exceeds_max_age(cc)
 
 	def exceeds_max_age(self, cache_control):
+		if 'max-age' not in cache_control:
+			# If max-age is not indicated, it can't be exceeded
+			return False
 		if not 'date' in self.headers:
 			return True
-		if 'max-age' not in cache_control:
-			return True
 		# user-agent might have a 'min-fresh' directive indicating the
 		#  client will only accept a cached request if it will still be
 		#  fresh min-fresh seconds from now.