comparison 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
parents 58b86b9149f1
children f1823b9f073b
comparison
equal deleted inserted replaced
13816:2540f8087e02 13817:7f18bab2c0b0
156 >>> url('a/b/c/d.g.f') 156 >>> url('a/b/c/d.g.f')
157 <url path: 'a/b/c/d.g.f'> 157 <url path: 'a/b/c/d.g.f'>
158 >>> url('/x///z/y/') 158 >>> url('/x///z/y/')
159 <url path: '/x///z/y/'> 159 <url path: '/x///z/y/'>
160 160
161 Non-localhost file URL:
162
163 >>> u = url('file://mercurial.selenic.com/foo')
164 Traceback (most recent call last):
165 File "<stdin>", line 1, in ?
166 Abort: file:// URLs can only refer to localhost
167
161 Empty URL: 168 Empty URL:
162 169
163 >>> u = url('') 170 >>> u = url('')
164 >>> u 171 >>> u
165 <url path: ''> 172 <url path: ''>