Changeset 2019
- Timestamp:
- 07/09/08 15:20:48
- Files:
-
- branches/cherrypy-2.x/cherrypy/lib/httptools.py (modified) (1 diff)
- branches/cherrypy-2.x/cherrypy/test/test_core.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cherrypy-2.x/cherrypy/lib/httptools.py
r1571 r2019 318 318 def parseRequestLine(requestLine): 319 319 """Return (method, path, querystring, protocol) from a requestLine.""" 320 method, path, protocol = requestLine.split() 321 320 splitLine = requestLine.split() 321 method, protocol = splitLine[0], splitLine[-1] 322 path = " ".join(splitLine[1:-1]) 323 322 324 # path may be an abs_path (including "http://host.domain.tld"); 323 325 # Ignore scheme, location, and fragments (so config lookups work). branches/cherrypy-2.x/cherrypy/test/test_core.py
r1855 r2019 328 328 cherrypy.root.divorce = Divorce() 329 329 330 class Encoded: 331 def default(self, *args): 332 return "Encoded response" 333 default.exposed = True 334 335 cherrypy.root.encoded = Encoded() 330 336 331 337 class Cookies(Test): … … 464 470 465 471 data = open(log_access_file, "rb").readlines() 466 self.assertEqual(data[0][:15], '127.0.0.1 - - [') 472 address = data[0].split()[0] 473 if address not in ['127.0.0.1', '::ffff:127.0.0.1', '::1']: 474 self.fail('access log did not contain remote IP:\n%s' % (data[0])) 475 467 476 haslength = False 468 477 for k, v in self.headers: … … 476 485 % self.prefix())) 477 486 478 self.assertEqual(data[1][:15], '127.0.0.1 - - [') 487 address = data[1].split()[0] 488 if address not in ['127.0.0.1', '::ffff:127.0.0.1', '::1']: 489 self.fail('access log did not contain remote IP:\n%s' % (data[0])) 490 479 491 haslength = False 480 492 for k, v in self.headers: … … 933 945 self.assertEqual(results, ["None"] * 20) 934 946 947 def testEncodedURL(self): 948 self.getPage('/encoded/%0Ax') 949 self.assertBody("Encoded response") 950 935 951 def testDefaultContentType(self): 936 952 self.getPage('/')

