diff tests/test-url.py @ 13848:b2798c1defff

url: be stricter about detecting schemes While the URL parser is very forgiving about what characters are allowed in each component, it's useful to be strict about the scheme so we don't accidentally interpret local paths with colons as URLs. This restricts schemes to containing alphanumeric characters, dashes, pluses, and dots (as specified in RFC 2396).
author Brodie Rao <brodie@bitheap.org>
date Thu, 31 Mar 2011 17:37:33 -0700
parents f1823b9f073b
children 924c82157d46
line wrap: on
line diff
--- a/tests/test-url.py	Fri Apr 01 11:45:29 2011 -0500
+++ b/tests/test-url.py	Thu Mar 31 17:37:33 2011 -0700
@@ -157,6 +157,12 @@
     <url path: 'a/b/c/d.g.f'>
     >>> url('/x///z/y/')
     <url path: '/x///z/y/'>
+    >>> url('/foo:bar')
+    <url path: '/foo:bar'>
+    >>> url('\\\\foo:bar')
+    <url path: '\\\\foo:bar'>
+    >>> url('./foo:bar')
+    <url path: './foo:bar'>
 
     Non-localhost file URL: