diff tests/test-url.py @ 13817:7f18bab2c0b0

url: abort on file:// URLs with non-localhost hosts
author Brodie Rao <brodie@bitheap.org>
date Wed, 30 Mar 2011 20:01:31 -0700 (2011-03-31)
parents 58b86b9149f1
children f1823b9f073b
line wrap: on
line diff
--- a/tests/test-url.py
+++ b/tests/test-url.py
@@ -158,6 +158,13 @@
     >>> url('/x///z/y/')
     <url path: '/x///z/y/'>
 
+    Non-localhost file URL:
+
+    >>> u = url('file://mercurial.selenic.com/foo')
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in ?
+    Abort: file:// URLs can only refer to localhost
+
     Empty URL:
 
     >>> u = url('')