From 6b58ade2f066beb7fa1339e494c09120b7e02976 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 2 Aug 2016 18:41:22 +0100 Subject: Comment on why we clone --- synapse/rest/media/v1/preview_url_resource.py | 1 + 1 file changed, 1 insertion(+) diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py index e1212313e1..64ad218f70 100644 --- a/synapse/rest/media/v1/preview_url_resource.py +++ b/synapse/rest/media/v1/preview_url_resource.py @@ -334,6 +334,7 @@ class PreviewUrlResource(Resource): # We don't just use XPATH here as that is slow on some machines. + # We clone `tree` as we modify it. cloned_tree = deepcopy(tree.find("body")) TAGS_TO_REMOVE = ("header", "nav", "aside", "footer", "script", "style",) -- cgit 1.4.1