Skip to content

Commit 35625ff

Browse files
author
Noor Dawod
committed
Couple of fixes.
1 parent 1e64da7 commit 35625ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sample/src/main/java/com/loopj/android/http/sample/Http401AuthSample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ public void onFailure(int statusCode, Header[] headers, Throwable throwable, Str
134134

135135
// Get the type of auth requested.
136136
int charPos = headerValueLowerCase.indexOf(' ');
137-
if(0 < charPos) {
137+
if (0 < charPos) {
138138
authType = headerValueLowerCase.substring(0, charPos);
139139

140140
// The second part should begin with a "realm=" prefix.
141-
if(headerValueLowerCase.substring(1 + charPos).startsWith(HEADER_REALM_PREFIX)) {
141+
if (headerValueLowerCase.substring(1 + charPos).startsWith(HEADER_REALM_PREFIX)) {
142142
// The new realm value, including any possible wrapping quotation.
143143
realm = headerValue.substring(1 + charPos + HEADER_REALM_PREFIX.length());
144144

@@ -154,7 +154,7 @@ public void onFailure(int statusCode, Header[] headers, Throwable throwable, Str
154154
// We will support basic auth in this sample.
155155
if (authType != null && HEADER_BASIC.equals(authType)) {
156156
// Show a dialog for the user and request user/pass.
157-
Log.d(LOG_TAG, "realm=" + realm);
157+
Log.d(LOG_TAG, HEADER_REALM_PREFIX + realm);
158158

159159
// Present the dialog.
160160
postRunnable(new DialogRunnable(realm));

0 commit comments

Comments
 (0)