Prechádzať zdrojové kódy

Fix substitution err for schemeless manifest urls

Previously, we used a regex that would only remove a phony string from
a url if it existed, but we recently replaced that with a slice.  This
change goes back to the previous behavior.

Change-Id: I8baf527be01c4b49d45b903b31a1cd6315563d5b
Conley Owens 10 rokov pred
rodič
commit
793c7041b8
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      manifest_xml.py

+ 2 - 1
manifest_xml.py

@@ -90,7 +90,8 @@ class _XmlRemote(object):
     # and then replacing it with the original when we are done.
 
     if manifestUrl.find(':') != manifestUrl.find('/') - 1:
-      url = urllib.parse.urljoin('gopher://' + manifestUrl, url)[9:]
+      url = urllib.parse.urljoin('gopher://' + manifestUrl, url)
+      url = re.sub(r'^gopher://', '', url)
     else:
       url = urllib.parse.urljoin(manifestUrl, url)
     return url