okhttp
okhttp copied to clipboard
StringIndexOutOfBoundsException on JavaNetCookieJar.java:103 - when the value contains only one double quote
okhttp_3.12.x JavaNetCookieJar.java (https://github.com/square/okhttp/blob/okhttp_3.12.x/okhttp-urlconnection/src/main/java/okhttp3/JavaNetCookieJar.java) Line: 103
if (value.startsWith("\"") && value.endsWith("\"")) {
value = value.substring(1, value.length() - 1);
}
Fails when the value contains only one double quote ("), because the length of the value=1, but it tries to substring with the startIndex=1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:2064)
at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.java:103)
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:74)
Unfortunately a number of tests on 3.12.x break now in the face of backports of features to JDK8. So it may not be a quick release.
Looking forward for the fix to be released, do I understand correctly that all of the versions are still affected by this issue?
No planned release of 3.12.x