mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 957059 - Refactor isCorrectManifest function to not match querystring and beyond in provided URLs; r=wesj
--HG-- extra : rebase_source : b9c647f1df91ab11f9041f3a9334efd9f8af9e43
This commit is contained in:
parent
cfaaad5e71
commit
cec6ac53c5
@ -82,15 +82,16 @@ public class InstallListener extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
public boolean isCorrectManifest(String manifestUrl) {
|
||||
// Don't use URL and the sameFile method as this also includes the query which
|
||||
// we want to ignore.
|
||||
try {
|
||||
URL registered = new URL(mManifestUrl);
|
||||
URL observed = new URL(manifestUrl);
|
||||
// TODO: this should be matching the scheme, origin and path, but ignoring the query.
|
||||
// That doesn't seem to be happening.
|
||||
return registered.sameFile(observed);
|
||||
} catch (MalformedURLException e) {
|
||||
return false;
|
||||
String registeredUrl = mManifestUrl.split("\\?")[0];
|
||||
String observedUrl = manifestUrl.split("\\?")[0];
|
||||
return registeredUrl.equals(observedUrl);
|
||||
} catch (NullPointerException e) {
|
||||
Log.e(LOGTAG, "One or both of the manifest URLs is null", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
|
Loading…
Reference in New Issue
Block a user