Changes between Version 10 and Version 11 of StripWhitespaceMiddleware
- Timestamp:
- Oct 26, 2016, 10:26:38 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StripWhitespaceMiddleware
v10 v11 32 32 def process_response(self, request, response): 33 33 if "text" in response['Content-Type']: 34 # Uncomment the next line to avoid failure on cached / HTTP 304 NOT MODIFIED responses without Content-Type 35 #if response.status_code == 200 and "text" in response['Content-Type']: 34 36 if hasattr(self, 'whitespace_lead'): 35 37 response.content = self.whitespace_lead.sub('', response.content) 36 38 if hasattr(self, 'whitespace_trail'): 37 39 response.content = self.whitespace_trail.sub('\n', response.content) 38 # Uncomment the next line to remove empty lines39 40 if hasattr(self, 'whitespace'): 40 41 response.content = self.whitespace.sub('', response.content)