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

Changeset 892

Show
Ignore:
Timestamp:
12/29/05 10:53:08
Author:
rdelon
Message:

Fix for #416. The default favicon.ico is now served by a default static_filter entry in the default config (much cleaner than making a special case for favicon.ico in the code).

Files:

Legend:

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

    r887 r892  
    300300                return candidate, names[:i+1], names[i+1:-1] 
    301301         
    302         # Not found at any node 
    303         if objectpath.endswith("favicon.ico"): 
    304             # Use CherryPy's default favicon.ico. If developers really, 
    305             # really want no favicon, they can make a dummy method 
    306             # that raises NotFound. 
    307             icofile = os.path.join(os.path.dirname(__file__), "favicon.ico") 
    308             cptools.serveFile(icofile) 
    309             applyFilters('before_finalize') 
    310             cherrypy.response.finalize() 
    311             raise cherrypy.RequestHandled() 
    312         else: 
    313             # We didn't find anything 
    314             raise cherrypy.NotFound(objectpath) 
    315  
     302        # We didn't find anything 
     303        raise cherrypy.NotFound(objectpath) 
    316304 
    317305general_header_fields = ["Cache-Control", "Connection", "Date", "Pragma", 
  • trunk/cherrypy/config.py

    r886 r892  
    22 
    33import ConfigParser 
     4import os 
    45 
    56import cherrypy 
     
    2526    'server.thread_pool': 0, 
    2627    'server.environment': "development", 
     28 
     29    '/favicon.ico': { 
     30        'static_filter.on': True, 
     31        'static_filter.file': os.path.join(os.path.dirname(__file__), "favicon.ico"),} 
    2732    } 
    2833 
  • trunk/cherrypy/test/test_core.py

    r891 r892  
    822822        self.assertBody(data) 
    823823         
    824         self.getPage("/redirect/favicon.ico") 
     824        self.getPage("/favicon.ico") 
    825825        self.assertBody(data) 
    826826     

Hosted by WebFaction

Log in as guest/cpguest to create tickets