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(";");
|
String[] cookies = mSessionCookie.split(";");
|
||||||
if (cookies.length > 0) {
|
if (cookies.length > 0) {
|
||||||
|
Cookie cookie = null;
|
||||||
for (int i=0; i<cookies.length; i++) {
|
for (int i=0; i<cookies.length; i++) {
|
||||||
Cookie cookie = new Cookie();
|
|
||||||
int equalPos = cookies[i].indexOf('=');
|
int equalPos = cookies[i].indexOf('=');
|
||||||
cookie.setName(cookies[i].substring(0, equalPos));
|
if (equalPos >= 0) {
|
||||||
cookie.setValue(cookies[i].substring(equalPos + 1));
|
cookie = new Cookie();
|
||||||
cookie.setDomain(serverUri.getHost()); // VERY IMPORTANT
|
cookie.setName(cookies[i].substring(0, equalPos));
|
||||||
cookie.setPath(serverUri.getPath()); // VERY IMPORTANT
|
cookie.setValue(cookies[i].substring(equalPos + 1));
|
||||||
client.getState().addCookie(cookie);
|
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