Merge pull request #847 from 1Panel-dev/detached
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

fix: 修复再次修改logo报错的缺陷
This commit is contained in:
wxg0103 2024-07-23 19:14:19 +08:00 committed by GitHub
commit fa497053ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,4 +39,6 @@ class ImageSerializer(serializers.Serializer):
image = QuerySet(Image).filter(id=image_id).first()
if image is None:
raise NotFound404(404, "不存在的图片")
if image.image_name.endswith('.svg'):
return HttpResponse(image.image, status=200, headers={'Content-Type': 'image/svg+xml'})
return HttpResponse(image.image, status=200, headers={'Content-Type': 'image/png'})