Changeset 1199
- Timestamp:
- 07/10/06 23:26:01
- Files:
-
- trunk/cherrypy/lib/http.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/http.py
r1168 r1199 130 130 131 131 132 q_separator = re.compile(r'; *q *=') 133 132 134 class AcceptElement(HeaderElement): 133 135 """An element (with parameters) from an Accept-* header's element list.""" … … 137 139 # The first "q" parameter (if any) separates the initial 138 140 # parameter(s) (if any) from the accept-params. 139 atoms = re.split(r'; *q *=',elementstr, 1)141 atoms = q_separator.split(elementstr, 1) 140 142 initial_value = atoms.pop(0).strip() 141 143 if atoms: … … 254 256 return code, reason, message 255 257 258 259 quoted_slash = re.compile("(?i)%2F") 260 256 261 def parse_request_line(request_line): 257 262 """Return (method, path, querystring, protocol) from a request_line.""" … … 276 281 # 277 282 # Note also that cgi.parse_qs will decode the querystring for us. 278 atoms = [unquote(x) for x in re.split("(?i)%2F",path)]283 atoms = [unquote(x) for x in quoted_slash.split(path)] 279 284 path = "%2F".join(atoms) 280 285 281 286 return method, path, qs, protocol 287 288 289 image_map_pattern = re.compile(r"[0-9]+,[0-9]+") 282 290 283 291 def parseQueryString(query_string, keep_blank_values=True): 284 292 """Build a paramMap dictionary from a query_string.""" 285 if re.match(r"[0-9]+,[0-9]+",query_string):293 if image_map_pattern.match(query_string): 286 294 # Server-side image map. Map the coords to 'x' and 'y' 287 295 # (like CGI::Request does).

