Skip to content

Commit 34f10c6

Browse files
committed
#8: fix typo
1 parent 776e777 commit 34f10c6

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/main/java/me/vzhilin/auth/DigestAuthenticator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ private QopOptions chooseQop(ChallengeResponse challenge) {
5656
return QopOptions.AUTH;
5757
}
5858

59-
public String autorizationHeader(String method, String uri) {
60-
return autorizationHeader(method, uri, "");
59+
public String authorizationHeader(String method, String uri) {
60+
return authorizationHeader(method, uri, "");
6161
}
6262

63-
public synchronized String autorizationHeader(String method, String uri, String entityBody) {
63+
public synchronized String authorizationHeader(String method, String uri, String entityBody) {
6464
if (digester.getNonce() == null) {
6565
return null;
6666
}

src/main/java/me/vzhilin/auth/netty/DigestNettyHttpAuthenticator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
6060

6161
String method = req.method().name();
6262
String uri = req.uri();
63-
final String header = authenticator.autorizationHeader(method, uri);
63+
final String header = authenticator.authorizationHeader(method, uri);
6464
if (header != null) {
6565
req.headers().set(HttpHeaderNames.AUTHORIZATION, header);
6666
}

src/main/java/me/vzhilin/auth/netty/TransparentDigestNettyHttpAuthenticator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
7979
if (authenticateHeader != null) {
8080
authenticator.onResponseReceived(ChallengeResponse.of(authenticateHeader), status.code());
8181
}
82-
final String auth = authenticator.autorizationHeader(request.method().name(), request.uri());
82+
final String auth = authenticator.authorizationHeader(request.method().name(), request.uri());
8383
if (auth != null) {
8484
request.headers().set(HttpHeaderNames.AUTHORIZATION, auth);
8585
}
@@ -115,7 +115,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
115115
String method = req.method().name();
116116
String uri = req.uri();
117117

118-
req.headers().set(HttpHeaderNames.AUTHORIZATION, authenticator.autorizationHeader(method, uri));
118+
req.headers().set(HttpHeaderNames.AUTHORIZATION, authenticator.authorizationHeader(method, uri));
119119
}
120120
// keep the client request
121121
// When server responds 401 Unauthorized, resend the request with authentication header

src/test/java/me/vzhilin/demo/webflux/WebFluxDemo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
4444
HttpRequest request = (HttpRequest) msg;
4545
String authorization = request.headers().get(HttpHeaderNames.AUTHORIZATION);
4646
if (authorization == null) {
47-
final String authorizationHeader = auth.autorizationHeader(request.method().name(), request.uri());
47+
final String authorizationHeader = auth.authorizationHeader(request.method().name(), request.uri());
4848
if (authorizationHeader != null) {
4949
request.headers().set(HttpHeaderNames.AUTHORIZATION, authorizationHeader);
5050
}

src/test/java/me/vzhilin/test/DigestAuthenticatorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public void digestAuth() throws Exception {
3636
authenticator.onResponseReceived(ChallengeResponse.of(firstResponse.getFirstHeader("WWW-Authenticate").getValue()),
3737
firstResponse.getStatusLine().getStatusCode());
3838

39-
request.setHeader("Authorization", authenticator.autorizationHeader("GET", uri.getPath()));
39+
request.setHeader("Authorization", authenticator.authorizationHeader("GET", uri.getPath()));
4040
CloseableHttpResponse secondResponse = httpClient.execute(request);
4141
EntityUtils.consume(secondResponse.getEntity());
4242
assertEquals("expected authorized", 200, secondResponse.getStatusLine().getStatusCode());
4343

44-
request.setHeader("Authorization", authenticator.autorizationHeader("GET", uri.getPath()));
44+
request.setHeader("Authorization", authenticator.authorizationHeader("GET", uri.getPath()));
4545
CloseableHttpResponse thirdResponse = httpClient.execute(request);
4646
EntityUtils.consume(thirdResponse.getEntity());
4747
assertEquals("ensure that digester is working", 200, thirdResponse.getStatusLine().getStatusCode());

0 commit comments

Comments
 (0)