Loading core/java/android/net/WebAddress.java +46 −7 Original line number Diff line number Diff line Loading @@ -39,13 +39,11 @@ import java.util.regex.Pattern; */ public class WebAddress { private final static String LOGTAG = "http"; public String mScheme; public String mHost; public int mPort; public String mPath; public String mAuthInfo; private String mScheme; private String mHost; private int mPort; private String mPath; private String mAuthInfo; static final int MATCH_GROUP_SCHEME = 1; static final int MATCH_GROUP_AUTHORITY = 2; Loading Loading @@ -122,6 +120,7 @@ public class WebAddress { if (mScheme.equals("")) mScheme = "http"; } @Override public String toString() { String port = ""; if ((mPort != 443 && mScheme.equals("https")) || Loading @@ -135,4 +134,44 @@ public class WebAddress { return mScheme + "://" + authInfo + mHost + port + mPath; } public void setScheme(String scheme) { mScheme = scheme; } public String getScheme() { return mScheme; } public void setHost(String host) { mHost = host; } public String getHost() { return mHost; } public void setPort(int port) { mPort = port; } public int getPort() { return mPort; } public void setPath(String path) { mPath = path; } public String getPath() { return mPath; } public void setAuthInfo(String authInfo) { mAuthInfo = authInfo; } public String getAuthInfo() { return mAuthInfo; } } core/java/android/net/http/RequestQueue.java +4 −4 Original line number Diff line number Diff line Loading @@ -327,10 +327,10 @@ public class RequestQueue implements RequestFeeder { /* Create and queue request */ Request req; HttpHost httpHost = new HttpHost(uri.mHost, uri.mPort, uri.mScheme); HttpHost httpHost = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); // set up request req = new Request(method, httpHost, mProxyHost, uri.mPath, bodyProvider, req = new Request(method, httpHost, mProxyHost, uri.getPath(), bodyProvider, bodyLength, eventHandler, headers); queueRequest(req, false); Loading Loading @@ -375,9 +375,9 @@ public class RequestQueue implements RequestFeeder { HttpLog.v("RequestQueue.dispatchSynchronousRequest " + uri); } HttpHost host = new HttpHost(uri.mHost, uri.mPort, uri.mScheme); HttpHost host = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); Request req = new Request(method, host, mProxyHost, uri.mPath, Request req = new Request(method, host, mProxyHost, uri.getPath(), bodyProvider, bodyLength, eventHandler, headers); // Open a new connection that uses our special RequestFeeder Loading core/java/android/webkit/BrowserFrame.java +2 −2 Original line number Diff line number Diff line Loading @@ -478,7 +478,7 @@ class BrowserFrame extends Handler { .getCurrentItem(); if (item != null) { WebAddress uri = new WebAddress(item.getUrl()); String schemePlusHost = uri.mScheme + uri.mHost; String schemePlusHost = uri.getScheme() + uri.getHost(); String[] up = mDatabase.getUsernamePassword(schemePlusHost); if (up != null && up[0] != null) { Loading Loading @@ -811,7 +811,7 @@ class BrowserFrame extends Handler { } WebAddress uri = new WebAddress(mCallbackProxy .getBackForwardList().getCurrentItem().getUrl()); String schemePlusHost = uri.mScheme + uri.mHost; String schemePlusHost = uri.getScheme() + uri.getHost(); String[] ret = getUsernamePassword(); // Has the user entered a username/password pair and is // there some POST data Loading core/java/android/webkit/CookieManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -359,7 +359,7 @@ public final class CookieManager { // negative means far future if (cookie.expires < 0 || cookie.expires > now) { // secure cookies can't be overwritten by non-HTTPS url if (!cookieEntry.secure || HTTPS.equals(uri.mScheme)) { if (!cookieEntry.secure || HTTPS.equals(uri.getScheme())) { cookieEntry.value = cookie.value; cookieEntry.expires = cookie.expires; cookieEntry.secure = cookie.secure; Loading Loading @@ -444,7 +444,7 @@ public final class CookieManager { } long now = System.currentTimeMillis(); boolean secure = HTTPS.equals(uri.mScheme); boolean secure = HTTPS.equals(uri.getScheme()); Iterator<Cookie> iter = cookieList.iterator(); SortedSet<Cookie> cookieSet = new TreeSet<Cookie>(COMPARATOR); Loading Loading @@ -692,7 +692,7 @@ public final class CookieManager { * ended with "/" */ private String[] getHostAndPath(WebAddress uri) { if (uri.mHost != null && uri.mPath != null) { if (uri.getHost() != null && uri.getPath() != null) { /* * The domain (i.e. host) portion of the cookie is supposed to be Loading @@ -703,12 +703,12 @@ public final class CookieManager { * See: http://www.ieft.org/rfc/rfc2965.txt (Section 3.3.3) */ String[] ret = new String[2]; ret[0] = uri.mHost.toLowerCase(); ret[1] = uri.mPath; ret[0] = uri.getHost().toLowerCase(); ret[1] = uri.getPath(); int index = ret[0].indexOf(PERIOD); if (index == -1) { if (uri.mScheme.equalsIgnoreCase("file")) { if (uri.getScheme().equalsIgnoreCase("file")) { // There is a potential bug where a local file path matches // another file in the local web server directory. Still // "localhost" is the best pseudo domain name. Loading core/java/android/webkit/LoadListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -682,7 +682,7 @@ class LoadListener extends Handler implements EventHandler { if (!mAuthFailed && mUsername != null && mPassword != null) { String host = mAuthHeader.isProxy() ? Network.getInstance(mContext).getProxyHostname() : mUri.mHost; mUri.getHost(); HttpAuthHandlerImpl.onReceivedCredentials(this, host, mAuthHeader.getRealm(), mUsername, mPassword); makeAuthResponse(mUsername, mPassword); Loading Loading @@ -952,7 +952,7 @@ class LoadListener extends Handler implements EventHandler { */ String host() { if (mUri != null) { return mUri.mHost; return mUri.getHost(); } return null; Loading Loading
core/java/android/net/WebAddress.java +46 −7 Original line number Diff line number Diff line Loading @@ -39,13 +39,11 @@ import java.util.regex.Pattern; */ public class WebAddress { private final static String LOGTAG = "http"; public String mScheme; public String mHost; public int mPort; public String mPath; public String mAuthInfo; private String mScheme; private String mHost; private int mPort; private String mPath; private String mAuthInfo; static final int MATCH_GROUP_SCHEME = 1; static final int MATCH_GROUP_AUTHORITY = 2; Loading Loading @@ -122,6 +120,7 @@ public class WebAddress { if (mScheme.equals("")) mScheme = "http"; } @Override public String toString() { String port = ""; if ((mPort != 443 && mScheme.equals("https")) || Loading @@ -135,4 +134,44 @@ public class WebAddress { return mScheme + "://" + authInfo + mHost + port + mPath; } public void setScheme(String scheme) { mScheme = scheme; } public String getScheme() { return mScheme; } public void setHost(String host) { mHost = host; } public String getHost() { return mHost; } public void setPort(int port) { mPort = port; } public int getPort() { return mPort; } public void setPath(String path) { mPath = path; } public String getPath() { return mPath; } public void setAuthInfo(String authInfo) { mAuthInfo = authInfo; } public String getAuthInfo() { return mAuthInfo; } }
core/java/android/net/http/RequestQueue.java +4 −4 Original line number Diff line number Diff line Loading @@ -327,10 +327,10 @@ public class RequestQueue implements RequestFeeder { /* Create and queue request */ Request req; HttpHost httpHost = new HttpHost(uri.mHost, uri.mPort, uri.mScheme); HttpHost httpHost = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); // set up request req = new Request(method, httpHost, mProxyHost, uri.mPath, bodyProvider, req = new Request(method, httpHost, mProxyHost, uri.getPath(), bodyProvider, bodyLength, eventHandler, headers); queueRequest(req, false); Loading Loading @@ -375,9 +375,9 @@ public class RequestQueue implements RequestFeeder { HttpLog.v("RequestQueue.dispatchSynchronousRequest " + uri); } HttpHost host = new HttpHost(uri.mHost, uri.mPort, uri.mScheme); HttpHost host = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); Request req = new Request(method, host, mProxyHost, uri.mPath, Request req = new Request(method, host, mProxyHost, uri.getPath(), bodyProvider, bodyLength, eventHandler, headers); // Open a new connection that uses our special RequestFeeder Loading
core/java/android/webkit/BrowserFrame.java +2 −2 Original line number Diff line number Diff line Loading @@ -478,7 +478,7 @@ class BrowserFrame extends Handler { .getCurrentItem(); if (item != null) { WebAddress uri = new WebAddress(item.getUrl()); String schemePlusHost = uri.mScheme + uri.mHost; String schemePlusHost = uri.getScheme() + uri.getHost(); String[] up = mDatabase.getUsernamePassword(schemePlusHost); if (up != null && up[0] != null) { Loading Loading @@ -811,7 +811,7 @@ class BrowserFrame extends Handler { } WebAddress uri = new WebAddress(mCallbackProxy .getBackForwardList().getCurrentItem().getUrl()); String schemePlusHost = uri.mScheme + uri.mHost; String schemePlusHost = uri.getScheme() + uri.getHost(); String[] ret = getUsernamePassword(); // Has the user entered a username/password pair and is // there some POST data Loading
core/java/android/webkit/CookieManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -359,7 +359,7 @@ public final class CookieManager { // negative means far future if (cookie.expires < 0 || cookie.expires > now) { // secure cookies can't be overwritten by non-HTTPS url if (!cookieEntry.secure || HTTPS.equals(uri.mScheme)) { if (!cookieEntry.secure || HTTPS.equals(uri.getScheme())) { cookieEntry.value = cookie.value; cookieEntry.expires = cookie.expires; cookieEntry.secure = cookie.secure; Loading Loading @@ -444,7 +444,7 @@ public final class CookieManager { } long now = System.currentTimeMillis(); boolean secure = HTTPS.equals(uri.mScheme); boolean secure = HTTPS.equals(uri.getScheme()); Iterator<Cookie> iter = cookieList.iterator(); SortedSet<Cookie> cookieSet = new TreeSet<Cookie>(COMPARATOR); Loading Loading @@ -692,7 +692,7 @@ public final class CookieManager { * ended with "/" */ private String[] getHostAndPath(WebAddress uri) { if (uri.mHost != null && uri.mPath != null) { if (uri.getHost() != null && uri.getPath() != null) { /* * The domain (i.e. host) portion of the cookie is supposed to be Loading @@ -703,12 +703,12 @@ public final class CookieManager { * See: http://www.ieft.org/rfc/rfc2965.txt (Section 3.3.3) */ String[] ret = new String[2]; ret[0] = uri.mHost.toLowerCase(); ret[1] = uri.mPath; ret[0] = uri.getHost().toLowerCase(); ret[1] = uri.getPath(); int index = ret[0].indexOf(PERIOD); if (index == -1) { if (uri.mScheme.equalsIgnoreCase("file")) { if (uri.getScheme().equalsIgnoreCase("file")) { // There is a potential bug where a local file path matches // another file in the local web server directory. Still // "localhost" is the best pseudo domain name. Loading
core/java/android/webkit/LoadListener.java +2 −2 Original line number Diff line number Diff line Loading @@ -682,7 +682,7 @@ class LoadListener extends Handler implements EventHandler { if (!mAuthFailed && mUsername != null && mPassword != null) { String host = mAuthHeader.isProxy() ? Network.getInstance(mContext).getProxyHostname() : mUri.mHost; mUri.getHost(); HttpAuthHandlerImpl.onReceivedCredentials(this, host, mAuthHeader.getRealm(), mUsername, mPassword); makeAuthResponse(mUsername, mPassword); Loading Loading @@ -952,7 +952,7 @@ class LoadListener extends Handler implements EventHandler { */ String host() { if (mUri != null) { return mUri.mHost; return mUri.getHost(); } return null; Loading