mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Fixed OutOfBoundsException
This commit is contained in:
parent
6cedc03465
commit
8080e4904d
@ -23,14 +23,17 @@ public class OwnCloudSamlSsoCredentials implements OwnCloudCredentials {
|
||||
|
||||
String[] cookies = mSessionCookie.split(";");
|
||||
if (cookies.length > 0) {
|
||||
Cookie cookie = null;
|
||||
for (int i=0; i<cookies.length; i++) {
|
||||
Cookie cookie = new Cookie();
|
||||
int equalPos = cookies[i].indexOf('=');
|
||||
cookie.setName(cookies[i].substring(0, equalPos));
|
||||
cookie.setValue(cookies[i].substring(equalPos + 1));
|
||||
cookie.setDomain(serverUri.getHost()); // VERY IMPORTANT
|
||||
cookie.setPath(serverUri.getPath()); // VERY IMPORTANT
|
||||
client.getState().addCookie(cookie);
|
||||
if (equalPos >= 0) {
|
||||
cookie = new Cookie();
|
||||
cookie.setName(cookies[i].substring(0, equalPos));
|
||||
cookie.setValue(cookies[i].substring(equalPos + 1));
|
||||
cookie.setDomain(serverUri.getHost()); // VERY IMPORTANT
|
||||
cookie.setPath(serverUri.getPath()); // VERY IMPORTANT
|
||||
client.getState().addCookie(cookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user