diff options
| author | Adam Vartanian <flooey@google.com> | 2017-11-07 23:50:35 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-11-07 23:50:35 +0000 |
| commit | 560fb5d05097514ec0ec28a47ccdcb6aeeab45c2 (patch) | |
| tree | 9ec3673ec88337b2feaf18175a9ec48095bd4305 /core/java/android/net/Uri.java | |
| parent | c4049e247f917f04dca7a620ae87fc77c0ee9e2e (diff) | |
| parent | a2149abe3a19b2fbc138a6d84e2b0034deb6f186 (diff) | |
Adjust Uri host parsing to use last instead of first @. am: cd6228dd37 am: 6a9c7c4814 am: 4158c9fbf3 am: eee677386e am: 49e5fca362 am: 240b55de2c am: 3ac5dabc21 am: f61daaa333 am: 49dfdd66cc am: eb4598afba
am: a2149abe3a
Change-Id: I48d611e91318a8f85f12fcff5fc00de8b1f834c9
Diffstat (limited to 'core/java/android/net/Uri.java')
| -rw-r--r-- | core/java/android/net/Uri.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java index d5377c717366..9edcc0e9b8d4 100644 --- a/core/java/android/net/Uri.java +++ b/core/java/android/net/Uri.java @@ -1066,7 +1066,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { return null; } - int end = authority.indexOf('@'); + int end = authority.lastIndexOf('@'); return end == NOT_FOUND ? null : authority.substring(0, end); } @@ -1090,7 +1090,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { } // Parse out user info and then port. - int userInfoSeparator = authority.indexOf('@'); + int userInfoSeparator = authority.lastIndexOf('@'); int portSeparator = authority.indexOf(':', userInfoSeparator); String encodedHost = portSeparator == NOT_FOUND @@ -1116,7 +1116,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { // Make sure we look for the port separtor *after* the user info // separator. We have URLs with a ':' in the user info. - int userInfoSeparator = authority.indexOf('@'); + int userInfoSeparator = authority.lastIndexOf('@'); int portSeparator = authority.indexOf(':', userInfoSeparator); if (portSeparator == NOT_FOUND) { |
