mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-08 03:08:29 +02:00
Prevent external redirects
This commit is contained in:
@@ -73,6 +73,13 @@ class BookmarkNewViewTestCase(TestCase, BookmarkFactoryMixin):
|
||||
|
||||
self.assertRedirects(response, reverse('bookmarks:index'))
|
||||
|
||||
def test_should_not_redirect_to_external_url(self):
|
||||
form_data = self.create_form_data()
|
||||
|
||||
response = self.client.post(reverse('bookmarks:new') + '?return_url=https://example.com', form_data)
|
||||
|
||||
self.assertRedirects(response, reverse('bookmarks:index'))
|
||||
|
||||
def test_auto_close_should_redirect_to_close_view(self):
|
||||
form_data = self.create_form_data({'auto_close': 'true'})
|
||||
|
||||
|
Reference in New Issue
Block a user