mirror of
https://github.com/clearml/clearml
synced 2025-02-07 21:33:25 +00:00
Fix URL for uploaded files with '%' in their name to allow proper unquote during HTTP serving
This commit is contained in:
parent
c6849985ea
commit
3ee70beea2
@ -319,6 +319,16 @@ class ImageEvent(UploadEvent):
|
||||
|
||||
def get_api_event(self):
|
||||
return events.MetricsImageEvent(
|
||||
url=self._url,
|
||||
# Hack: replace single '%' with quoted value '%25',
|
||||
# allowing the link to be properly unquoted during http serving
|
||||
url=self._url
|
||||
if (
|
||||
not self._url
|
||||
or self._url.startswith("file://")
|
||||
or self._url.startswith("/")
|
||||
or self._url.startswith("\\")
|
||||
)
|
||||
else self._url.replace("%", "%25"),
|
||||
key=self._key,
|
||||
**self._get_base_dict())
|
||||
**self._get_base_dict()
|
||||
)
|
||||
|
@ -533,6 +533,11 @@ class Reporter(InterfaceBase, AbstractContextManager, SetupUploadMixin, AsyncMan
|
||||
return self.report_image_and_upload(title=title, series=series, iter=iter, path=path, image=matrix,
|
||||
upload_uri=upload_uri, max_image_history=max_image_history)
|
||||
|
||||
# Hack: replace single '%' with quoted value '%25',
|
||||
# allowing the link to be properly unquoted during http serving
|
||||
if url:
|
||||
url = url.replace('%', '%25')
|
||||
|
||||
self._report(ev)
|
||||
plotly_dict = create_image_plot(
|
||||
image_src=url,
|
||||
|
Loading…
Reference in New Issue
Block a user