mirror of https://github.com/shred/acme4j
Log HEAD request and its headers
parent
acfb2d315d
commit
2370749e16
|
@ -106,11 +106,15 @@ public class DefaultConnection implements Connection {
|
||||||
|
|
||||||
URL newNonceUrl = session.resourceUrl(Resource.NEW_NONCE);
|
URL newNonceUrl = session.resourceUrl(Resource.NEW_NONCE);
|
||||||
|
|
||||||
|
LOG.debug("HEAD {}", newNonceUrl);
|
||||||
|
|
||||||
conn = httpConnector.openConnection(newNonceUrl, session.getProxy());
|
conn = httpConnector.openConnection(newNonceUrl, session.getProxy());
|
||||||
conn.setRequestMethod("HEAD");
|
conn.setRequestMethod("HEAD");
|
||||||
conn.setRequestProperty(ACCEPT_LANGUAGE_HEADER, session.getLocale().toLanguageTag());
|
conn.setRequestProperty(ACCEPT_LANGUAGE_HEADER, session.getLocale().toLanguageTag());
|
||||||
conn.connect();
|
conn.connect();
|
||||||
|
|
||||||
|
logHeaders();
|
||||||
|
|
||||||
int rc = conn.getResponseCode();
|
int rc = conn.getResponseCode();
|
||||||
if (rc != HttpURLConnection.HTTP_OK && rc != HttpURLConnection.HTTP_NO_CONTENT) {
|
if (rc != HttpURLConnection.HTTP_OK && rc != HttpURLConnection.HTTP_NO_CONTENT) {
|
||||||
throwAcmeException();
|
throwAcmeException();
|
||||||
|
|
|
@ -188,6 +188,7 @@ public class DefaultConnectionTest {
|
||||||
verify(mockUrlConnection, atLeastOnce()).connect();
|
verify(mockUrlConnection, atLeastOnce()).connect();
|
||||||
verify(mockUrlConnection, atLeastOnce()).getResponseCode();
|
verify(mockUrlConnection, atLeastOnce()).getResponseCode();
|
||||||
verify(mockUrlConnection, atLeastOnce()).getHeaderField("Replay-Nonce");
|
verify(mockUrlConnection, atLeastOnce()).getHeaderField("Replay-Nonce");
|
||||||
|
verify(mockUrlConnection, atLeastOnce()).getHeaderFields();
|
||||||
verifyNoMoreInteractions(mockUrlConnection);
|
verifyNoMoreInteractions(mockUrlConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue