Changeset 1687
- Timestamp:
- 06/23/07 21:45:12
- Files:
-
- trunk/cherrypy/lib/http.py (modified) (1 diff)
- trunk/cherrypy/test/test_httplib.py (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/http.py
r1671 r1687 27 27 28 28 def urljoin(*atoms): 29 """Return the given path *atoms, joined into a single URL.""" 30 url = "/".join(atoms) 29 """Return the given path *atoms, joined into a single URL. 30 31 This will correctly join a SCRIPT_NAME and PATH_INFO into the 32 original URL, even if either atom is blank. 33 """ 34 url = "/".join([x for x in atoms if x]) 31 35 while "//" in url: 32 36 url = url.replace("//", "/") 33 return url 37 # Special-case the final url of "", and return "/" instead. 38 return url or "/" 34 39 35 40 def protocol_from_http(protocol_str):

