Skip to content

Commit 4d271ac

Browse files
committed
fix typos
1 parent 91e7495 commit 4d271ac

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/main/java/org/privacyidea/AsyncRequestCallable.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
public class AsyncRequestCallable implements Callable<String>, Callback
1919
{
20-
2120
private String path;
2221
private final String method;
2322
private final Map<String, String> headers;
@@ -43,7 +42,7 @@ public AsyncRequestCallable(PrivacyIDEA privacyIDEA, Endpoint endpoint, String p
4342
@Override
4443
public String call() throws Exception
4544
{
46-
// If an auth token is required for the request get that first then do the actual request
45+
// If an auth token is required for the request, get that first then do the actual request
4746
if (this.authTokenRequired)
4847
{
4948
if (!privacyIDEA.serviceAccountAvailable())
@@ -62,7 +61,7 @@ public String call() throws Exception
6261
String authToken = privacyIDEA.parser.extractAuthToken(response);
6362
if (authToken == null)
6463
{
65-
// the parser already logs the error.
64+
// The parser already logs the error.
6665
return null;
6766
}
6867
// Add the auth token to the header
@@ -99,4 +98,4 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
9998
}
10099
latch.countDown();
101100
}
102-
}
101+
}

src/main/java/org/privacyidea/Endpoint.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import okhttp3.HttpUrl;
3434
import okhttp3.OkHttpClient;
3535
import okhttp3.Request;
36+
import okhttp3.internal.connection.RealCall;
3637

3738
import static org.privacyidea.PIConstants.GET;
3839
import static org.privacyidea.PIConstants.HEADER_USER_AGENT;
@@ -109,13 +110,12 @@ void sendRequestAsync(String endpoint, Map<String, String> params, Map<String, S
109110
{
110111
privacyIDEA.error("Server url could not be parsed: " + (piconfig.serverURL + endpoint));
111112
// Invoke the callback to terminate the thread that called this method.
112-
// TODO
113113
callback.onFailure(null,
114114
new IOException("Request could not be created because the url could not be parsed"));
115115
return;
116116
}
117117
HttpUrl.Builder urlBuilder = httpUrl.newBuilder();
118-
privacyIDEA.log("Sending to " + endpoint);
118+
privacyIDEA.log(method + " " + endpoint);
119119
params.forEach((k, v) ->
120120
{
121121
if (k.equals("pass") || k.equals("password"))
@@ -166,8 +166,8 @@ void sendRequestAsync(String endpoint, Map<String, String> params, Map<String, S
166166
if (key != null && value != null)
167167
{
168168
String encValue = value;
169-
// WebAuthn params are excluded from url encoded,
170-
// they are already in the correct format for the server
169+
// WebAuthn params are excluded from url encoding,
170+
// they are already in the correct encoding for the server
171171
if (!WEBAUTHN_PARAMETERS.contains(key))
172172
{
173173
try

src/main/java/org/privacyidea/PrivacyIDEA.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ private void appendRealm(Map<String, String> params)
403403
private String runRequestAsync(String path, Map<String, String> params, Map<String, String> headers,
404404
boolean authTokenRequired, String method)
405405
{
406-
407406
Callable<String> callable = new AsyncRequestCallable(this, endpoint, path, params, headers, authTokenRequired,
408407
method);
409408
Future<String> future = threadPool.submit(callable);

0 commit comments

Comments
 (0)