Changeset 812
- Timestamp:
- 11/10/05 17:13:04
- Files:
-
- trunk/cherrypy/_cphttptools.py (modified) (4 diffs)
- trunk/cherrypy/lib/httptools.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cphttptools.py
r811 r812 63 63 # right away. 64 64 self.processRequestLine(requestLine) 65 65 66 66 # if we receive OPTIONS * HTTP/1.1 67 67 # then we should simply answer right away … … 71 71 if self.path == 'global': 72 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() 73 response = cherrypy.response 74 if response.version >= '1.1': 75 response.body = [] 76 response.status = '200 OK' 77 response.headerMap['Allow'] = 'HEAD, GET, POST, PUT, OPTIONS' 78 response.headerMap['Content-Length'] = 0 79 response.headerMap['Content-Type'] = 'text/plain' 80 response.finalize() 80 81 _cputil.getSpecialAttribute("_cpLogAccess")() 81 82 return 82 83 83 84 try: 84 85 applyFilters('onStartResource') … … 135 136 # the object that will get rendered 136 137 self.objectPath = path 137 138 def processHeaders(self): 138 139 139 # Compare request and server HTTP versions, in case our server does 140 140 # not support the requested version. We can't tell the server what … … 159 159 # not to include a given HTTP/1.1 feature in the response content. 160 160 cherrypy.response.version = min(self.version, server_v) 161 162 def processHeaders(self): 161 163 162 164 self.paramMap = httptools.parseQueryString(self.queryString) trunk/cherrypy/lib/httptools.py
r801 r812 61 61 62 62 def __init__(self, atoms): 63 """A Version object. A str argument will be split on word boundaries.""" 63 """A Version object. 64 65 atoms: if a str, it will be split on word boundaries; 66 if a float or int, it will be split at the decimal point. 67 """ 68 if isinstance(atoms, (int, float)): 69 atoms = str(atoms) 64 70 if isinstance(atoms, basestring): 65 71 self.atoms = re.split(r'\W', atoms)

