mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.6.x] Prevented reverse() from generating URLs pointing to other hosts.
This is a security fix. Disclosure following shortly.
This commit is contained in:
committed by
Tim Graham
parent
52b878d805
commit
da051da8df
@@ -147,6 +147,9 @@ test_data = (
|
||||
('defaults', '/defaults_view2/3/', [], {'arg1': 3, 'arg2': 2}),
|
||||
('defaults', NoReverseMatch, [], {'arg1': 3, 'arg2': 3}),
|
||||
('defaults', NoReverseMatch, [], {'arg2': 1}),
|
||||
|
||||
# Security tests
|
||||
('security', '/%2Fexample.com/security/', ['/example.com'], {}),
|
||||
)
|
||||
|
||||
class NoURLPatternsTests(TestCase):
|
||||
|
||||
@@ -71,4 +71,7 @@ urlpatterns = patterns('',
|
||||
(r'defaults_view2/(?P<arg1>\d+)/', 'defaults_view', {'arg2': 2}, 'defaults'),
|
||||
|
||||
url('^includes/', include(other_patterns)),
|
||||
|
||||
# Security tests
|
||||
url('(.+)/security/$', empty_view, name='security'),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user