Changes between Version 12 and Version 13 of StripWhitespaceMiddleware


Ignore:
Timestamp:
Oct 26, 2016, 10:30:08 AM (8 years ago)
Author:
matsaman
Comment:

again

Legend:

Unmodified
Added
Removed
Modified
  • StripWhitespaceMiddleware

    v12 v13  
    2626    def __init__(self):
    2727        self.whitespace = re.compile('^\s*\n', re.MULTILINE)
    28         # self.whitespace_lead = re.compile('^\s+', re.MULTILINE)
    29         # self.whitespace_trail = re.compile('\s+$', re.MULTILINE)
     28        #self.whitespace_lead = re.compile('^\s+', re.MULTILINE)
     29        #self.whitespace_trail = re.compile('\s+$', re.MULTILINE)
    3030
    3131
    3232    def process_response(self, request, response):
    3333        if "text" in response['Content-Type']:
    34         #Replace preceding 'if' with following commented 'if' to avoid failure on cached / HTTP 304 NOT MODIFIED responses without Content-Type
     34        #Use next line instead to avoid failure on cached / HTTP 304 NOT MODIFIED responses without Content-Type
    3535        #if response.status_code == 200 and "text" in response['Content-Type']:
    3636            if hasattr(self, 'whitespace_lead'):
Back to Top