Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 821

Show
Ignore:
Timestamp:
11/13/05 22:11:09
Author:
fumanchu
Message:

Oops. Forgot to limit encodings to only text/* content.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/filters/encodingfilter.py

    r820 r821  
    8383            return 
    8484         
    85         charset = self.find_acceptable_charset() 
    86          
    87         # Set "charset=..." param on response Content-Type header 
    8885        ct = cherrypy.response.headerMap.elements("Content-Type") 
    8986        if ct is not None: 
    9087            ct = ct[0] 
    91             ct.params['charset'] = charset 
    92             cherrypy.response.headerMap["Content-Type"] = str(ct) 
     88            if ct.value.lower().startswith("text/"): 
     89                # Set "charset=..." param on response Content-Type header 
     90                ct.params['charset'] = self.find_acceptable_charset() 
     91                cherrypy.response.headerMap["Content-Type"] = str(ct) 
    9392 

Hosted by WebFaction

Log in as guest/cpguest to create tickets