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

Changeset 811

Show
Ignore:
Timestamp:
11/10/05 16:27:10
Author:
lawouach
Message:

added support for OPTIONS * request

Files:

Legend:

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

    r808 r811  
    6363            # right away. 
    6464            self.processRequestLine(requestLine) 
    65              
     65 
     66            # if we receive OPTIONS * HTTP/1.1 
     67            # then we should simply answer right away 
     68            if self.method == 'OPTIONS': 
     69                # this normally should be * but processRequestLine 
     70                # switched it to 'global' for the configuration handling 
     71                if self.path == 'global': 
     72                    # OPTIONS is defined in HTTP 1.1 
     73                    if self.protocol == 'HTTP/1.1': 
     74                        cherrypy.response.body = [] 
     75                        cherrypy.response.status = '200 OK' 
     76                        cherrypy.response.headerMap['Allow'] = 'HEAD, GET, POST, PUT, OPTIONS' 
     77                        cherrypy.response.headerMap['Content-Length'] = 0 
     78                        cherrypy.response.headerMap['Content-Type'] = 'text/plain' 
     79                        cherrypy.response.finalize() 
     80                        _cputil.getSpecialAttribute("_cpLogAccess")() 
     81                        return 
     82                     
    6683            try: 
    6784                applyFilters('onStartResource') 

Hosted by WebFaction

Log in as guest/cpguest to create tickets