Better way to handle relative URLs in manifest XML
The old implementation will NOT strip the filename part from the baseUrl, e.g. https://android.googlesource.com/platform/manifest with .. will be resolved to https://android.googlesource.com/platform/, which is actually wrong. This implementation will resolve it to https://android.googlesource.com/ to match the behavior of repo. Change-Id: Ia32c8b34e16eacdf37a0da7025bf0b5cc5f67ed2 Signed-off-by: Yuxuan 'fishy' Wang <fishywang@google.com>
This commit is contained in:
parent
64b0531c35
commit
39001eacc1
|
@ -351,8 +351,8 @@ public void endDocument() throws SAXException {
|
|||
}
|
||||
final String remoteUrl;
|
||||
try {
|
||||
URI uri = new URI(String.format("%s/%s/", baseUrl, remotes.get(defaultRemote))); //$NON-NLS-1$
|
||||
remoteUrl = uri.normalize().toString();
|
||||
URI uri = new URI(baseUrl);
|
||||
remoteUrl = uri.resolve(remotes.get(defaultRemote)).toString();
|
||||
} catch (URISyntaxException e) {
|
||||
throw new SAXException(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue