Skip to content

Commit

Permalink
Manually configure image/x-icon mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker committed Aug 15, 2023
1 parent 2f3c66a commit e293845
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bookmarks/services/favicon_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

logger = logging.getLogger(__name__)

# register mime type for .ico files, which is not included in the default
# mimetypes of the Docker image
mimetypes.add_type('image/x-icon', '.ico')


def _ensure_favicon_folder():
Path(settings.LD_FAVICON_FOLDER).mkdir(parents=True, exist_ok=True)
Expand Down
1 change: 0 additions & 1 deletion bookmarks/tests/test_favicon_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def test_custom_provider_with_domain_param(self):
favicon_loader.load_favicon('https://example.com/foo?bar=baz')
mock_get.assert_called_with('https://custom.icons.com/?url=example.com', stream=True)

@skip("Fails in CI, probably missing some dependency for mime types")
def test_guess_file_extension(self):
with mock.patch('requests.get') as mock_get:
mock_get.return_value = self.create_mock_response(content_type='image/png')
Expand Down

0 comments on commit e293845

Please sign in to comment.