mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-12 21:19:26 +02:00
Prevent external redirects
This commit is contained in:
@@ -44,3 +44,12 @@ class BookmarkArchiveViewTestCase(TestCase, BookmarkFactoryMixin):
|
||||
|
||||
self.assertEqual(response.status_code, 404)
|
||||
self.assertFalse(bookmark.is_archived)
|
||||
|
||||
def test_should_not_redirect_to_external_url(self):
|
||||
bookmark = self.setup_bookmark()
|
||||
|
||||
response = self.client.get(
|
||||
reverse('bookmarks:archive', args=[bookmark.id]) + '?return_url=https://example.com'
|
||||
)
|
||||
|
||||
self.assertRedirects(response, reverse('bookmarks:index'))
|
||||
|
Reference in New Issue
Block a user