Changes between Version 8 and Version 9 of StripWhitespaceMiddleware
- Timestamp:
- May 6, 2012, 9:40:57 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StripWhitespaceMiddleware
v8 v9 32 32 def process_response(self, request, response): 33 33 if "text" in response['Content-Type']: 34 new_content = self.whitespace_lead.sub('', response.content) 35 new_content = self.whitespace_trail.sub('\n', new_content) 34 36 # Uncomment the next line to remove empty lines 35 37 # new_content = self.whitespace.sub('', new_content) 36 new_content = self.whitespace_lead.sub('', response.content)37 new_content = self.whitespace_trail.sub('\n', new_content)38 38 response.content = new_content 39 39 return response