Commits

Robert Brewer  committed 1c3424e

Backport of [2143] (Long-standing misfeature: staticdir/file should only answer to GET/HEAD).

  • Participants
  • Parent commits 7ed91b3
  • Branches cherrypy-3.1.x

Comments (0)

Files changed (1)

File cherrypy/lib/static.py

     '/home/me', the Request-URI is 'myapp', and the index arg is
     'index.html', the file '/home/me/myapp/index.html' will be sought.
     """
+    if cherrypy.request.method not in ('GET', 'HEAD'):
+        return False
+    
     if match and not re.search(match, cherrypy.request.path_info):
         return False
     
     a string (e.g. "gif") and 'content-type' is the value to write
     out in the Content-Type response header (e.g. "image/gif").
     """
+    if cherrypy.request.method not in ('GET', 'HEAD'):
+        return False
+    
     if match and not re.search(match, cherrypy.request.path_info):
         return False