Changeset 1836
- Timestamp:
- 01/12/08 17:13:17
- Files:
-
- trunk/cherrypy/lib/http.py (modified) (2 diffs)
- trunk/cherrypy/test/test_core.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/http.py
r1786 r1836 50 50 function will return the list [(3, 7)]. 51 51 52 If this function return an empty list, you should return HTTP 416.52 If this function returns an empty list, you should return HTTP 416. 53 53 """ 54 54 … … 113 113 # Split the element into a value and parameters. The 'value' may 114 114 # be of the form, "token=token", but we don't split that here. 115 atoms = [x.strip() for x in elementstr.split(";") ]115 atoms = [x.strip() for x in elementstr.split(";") if x.strip()] 116 116 initial_value = atoms.pop(0).strip() 117 117 params = {} trunk/cherrypy/test/test_core.py
r1789 r1836 846 846 "en-gb;q=0.8\n" 847 847 "en;q=0.7") 848 849 # Test malformed header parsing. See http://www.cherrypy.org/ticket/763. 850 self.getPage("/headerelements/get_elements?headername=Content-Type", 851 # Note the illegal trailing ";" 852 headers=[('Content-Type', 'text/html; charset=utf-8;')]) 853 self.assertStatus(200) 854 self.assertBody("text/html;charset=utf-8") 848 855 849 856 def testHeaders(self): … … 890 897 headers=[("Content-type", "application/json")]) 891 898 self.assertBody("application/json") 892 899 893 900 def testHTTPMethods(self): 894 901 helper.webtest.methods_with_bodies = ("POST", "PUT", "PROPFIND")

