summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2010-03-31 13:35:24 -0400
committerPatrick Scott <phanna@android.com>2010-03-31 13:36:47 -0400
commit9253446922d925f6a5453b60d539beed292921a7 (patch)
treecb7039ceb794268f0490cc42eefb4d5a7e0f737c /core
parent711065587b46ea0279788757c49a273ff796f844 (diff)
downloadframeworks_base-9253446922d925f6a5453b60d539beed292921a7.zip
frameworks_base-9253446922d925f6a5453b60d539beed292921a7.tar.gz
frameworks_base-9253446922d925f6a5453b60d539beed292921a7.tar.bz2
Use case insensitive matching.
Use the lowercase version of the protocol. Bug: 2560217 Change-Id: Ibfadf4ba363968df9caf22c9ab36f666ee44d1db
Diffstat (limited to 'core')
-rw-r--r--core/java/android/net/WebAddress.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/net/WebAddress.java b/core/java/android/net/WebAddress.java
index e5bc6e3..4101ab4 100644
--- a/core/java/android/net/WebAddress.java
+++ b/core/java/android/net/WebAddress.java
@@ -54,12 +54,12 @@ public class WebAddress {
static final int MATCH_GROUP_PATH = 5;
static Pattern sAddressPattern = Pattern.compile(
- /* scheme */ "(?:(http|HTTP|https|HTTPS|file|FILE)\\:\\/\\/)?" +
+ /* scheme */ "(?:(http|https|file)\\:\\/\\/)?" +
/* authority */ "(?:([-A-Za-z0-9$_.+!*'(),;?&=]+(?:\\:[-A-Za-z0-9$_.+!*'(),;?&=]+)?)@)?" +
/* host */ "([-" + GOOD_IRI_CHAR + "%_]+(?:\\.[-" + GOOD_IRI_CHAR + "%_]+)*|\\[[0-9a-fA-F:\\.]+\\])?" +
/* port */ "(?:\\:([0-9]*))?" +
/* path */ "(\\/?[^#]*)?" +
- /* anchor */ ".*");
+ /* anchor */ ".*", Pattern.CASE_INSENSITIVE);
/** parses given uriString. */
public WebAddress(String address) throws ParseException {
@@ -79,7 +79,7 @@ public class WebAddress {
String t;
if (m.matches()) {
t = m.group(MATCH_GROUP_SCHEME);
- if (t != null) mScheme = t;
+ if (t != null) mScheme = t.toLowerCase();
t = m.group(MATCH_GROUP_AUTHORITY);
if (t != null) mAuthInfo = t;
t = m.group(MATCH_GROUP_HOST);