瀏覽代碼

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 年之前
父節點
當前提交
793c7041b8
共有 1 個文件被更改,包括 2 次插入1 次删除
  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