Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]


## [2.35.2] - 2026-03-17
### Fixed
- [PORTAL] [TEMPLATE] Wrong media-type for base64 encoded images


## [2.35.1] - 2026-03-06
### Added
- [API_PARSER] Add api_collector parameters in the returned representation of Frontends through APIs
Expand Down
8 changes: 4 additions & 4 deletions vulture_os/authentication/portal_template/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ def get_image_uri(self):
:return: String containing the URI of the image.
"""
try:
url = 'portal_statics/{}'.format(self.uid)
except:
url = f"portal_statics/{self.uid}"
except Exception:
return None

return url
Expand All @@ -429,12 +429,12 @@ def get_as_html(self):
:return: A string with pre-formatted html for the image
"""

return "<img src='data:image/{};base64,{}'/>".format(self.image_type, self.content)
return f"<img src='data:{self.image_type};base64,{self.content}'/>"

def create_preview_html(self):
"""
Return a pre-formatted html containing the image.
:return: A string with pre-formatted html for the image
"""

return "data:image/{};base64,{}".format(self.image_type, self.content)
return f"data:{self.image_type};base64,{self.content}"
2 changes: 1 addition & 1 deletion vulture_os/portal/system/authentications.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def authenticate(self, request):
def ask_credentials_response(self, **kwargs):
if self.workflow.authentication.enable_captcha:
captcha_key = self.redis_portal_session.register_captcha(self.workflow.id)
captcha = "data:image/image/png;base64," + b64encode(ImageCaptcha().generate(captcha_key).read()).decode()
captcha = "data:image/png;base64," + b64encode(ImageCaptcha().generate(captcha_key).read()).decode()
else:
captcha = False

Expand Down
Loading