Skip to content

Commit 52231ac

Browse files
committed
Fix LoginTokenInterceptor not working for responses with unknown length
1 parent 519431e commit 52231ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

library/src/main/java/me/proxer/library/api/LoginTokenInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private void handleResponse(final Response response) throws IOException {
9797
private String peekResponseBody(final Response response) throws IOException {
9898
final ResponseBody safeBody = response.body();
9999

100-
return safeBody != null && safeBody.contentLength() > 0 ? response.peekBody(MAX_PEEK_BYTE_COUNT).string() : "";
100+
return safeBody != null && safeBody.contentLength() != 0 ? response.peekBody(MAX_PEEK_BYTE_COUNT).string() : "";
101101
}
102102

103103
private boolean isLoginError(final ServerErrorType errorType) {

0 commit comments

Comments
 (0)