Commit 3ca7bc49 authored by Sven Franck's avatar Sven Franck

erp5_web: raise non-base64 convert instead of letting cloudoo guess

parent 9dea97d6
...@@ -132,10 +132,15 @@ def handleHref(href): ...@@ -132,10 +132,15 @@ def handleHref(href):
return href return href
try: try:
obj = traverseHref(href) obj = traverseHref(href)
except (KeyError, Unauthorized): except KeyError:
# KeyError can be side_object_dict[domain] KeyError raise Exception("KeyError: %s" % (href))
# or restrictedTraverse(path) KeyError except Unauthorized:
return makeHrefAbsolute(href) raise Exception("Unauthorized: %s" % (href))
#except (KeyError, Unauthorized):
## KeyError can be side_object_dict[domain] KeyError
## or restrictedTraverse(path) KeyError
# impossible to debug if we let cloudooo decide what to do
#return makeHrefAbsolute(href)
return handleHrefObject(obj, href) return handleHrefObject(obj, href)
def handleImageSource(src): def handleImageSource(src):
...@@ -202,7 +207,6 @@ def handleHrefObject(obj, src, default_mimetype="text/html", default_data="<p>Li ...@@ -202,7 +207,6 @@ def handleHrefObject(obj, src, default_mimetype="text/html", default_data="<p>Li
if isinstance(data, unicode): if isinstance(data, unicode):
data = data.encode("utf-8") data = data.encode("utf-8")
return handleLinkedData(mime, data, src) return handleLinkedData(mime, data, src)
return handleLinkedData(default_mimetype, default_data, src) return handleLinkedData(default_mimetype, default_data, src)
bad_image_data_url = ( bad_image_data_url = (
...@@ -352,5 +356,4 @@ def anny(iterable, key=None): ...@@ -352,5 +356,4 @@ def anny(iterable, key=None):
if i: if i:
return True return True
return False return False
return main(data) return main(data)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment