am 9128217d
: Merge forward small bug found in password storage
* commit '9128217da1f8ae53f1c44f369934ff075ae5057b': Merge forward small bug found in password storage
This commit is contained in:
commit
7ab349f971
@ -2683,8 +2683,8 @@ public abstract class EmailContent {
|
|||||||
String userInfo = null;
|
String userInfo = null;
|
||||||
if ((mFlags & FLAG_AUTHENTICATE) != 0) {
|
if ((mFlags & FLAG_AUTHENTICATE) != 0) {
|
||||||
String trimUser = (mLogin != null) ? mLogin.trim() : "";
|
String trimUser = (mLogin != null) ? mLogin.trim() : "";
|
||||||
String trimPassword = (mPassword != null) ? mPassword.trim() : "";
|
String password = (mPassword != null) ? mPassword : "";
|
||||||
userInfo = trimUser + ":" + trimPassword;
|
userInfo = trimUser + ":" + password;
|
||||||
}
|
}
|
||||||
String address = (mAddress != null) ? mAddress.trim() : null;
|
String address = (mAddress != null) ? mAddress.trim() : null;
|
||||||
String path = (mDomain != null) ? "/" + mDomain : null;
|
String path = (mDomain != null) ? "/" + mDomain : null;
|
||||||
|
@ -354,6 +354,27 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> {
|
|||||||
assertEquals(587, ha.mPort);
|
assertEquals(587, ha.mPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test preservation of username & password in URI
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public void testHostAuthUri() {
|
||||||
|
HostAuth ha = new HostAuth();
|
||||||
|
ha.setStoreUri("protocol://user:password@server:123");
|
||||||
|
String getUri = ha.getStoreUri();
|
||||||
|
assertEquals("protocol://user:password@server:123", getUri);
|
||||||
|
|
||||||
|
// Now put spaces in/around username (they are trimmed)
|
||||||
|
ha.setStoreUri("protocol://%20us%20er%20:password@server:123");
|
||||||
|
getUri = ha.getStoreUri();
|
||||||
|
assertEquals("protocol://us%20er:password@server:123", getUri);
|
||||||
|
|
||||||
|
// Now put spaces around password (should not be trimmed)
|
||||||
|
ha.setStoreUri("protocol://user:%20pass%20word%20@server:123");
|
||||||
|
getUri = ha.getStoreUri();
|
||||||
|
assertEquals("protocol://user:%20pass%20word%20@server:123", getUri);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test simple mailbox save/retrieve
|
* Test simple mailbox save/retrieve
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user