1
0
mirror of https://github.com/google/nomulus synced 2026-01-06 21:47:31 +00:00

Fix typo in header name in Client Certificate Provider (#946)

* Fix typo in header name

* fix test
This commit is contained in:
sarahcaseybot
2021-01-26 20:10:41 -05:00
committed by GitHub
parent a3537447ef
commit ad8bc05877
2 changed files with 3 additions and 2 deletions

View File

@@ -289,7 +289,7 @@ public class TlsCredentials implements TransportCredentials {
static Optional<String> provideClientCertificate(HttpServletRequest req) {
// Note: This header is actually required, we just want to handle its absence explicitly
// by throwing an EPP exception rather than a generic Bad Request exception.
return extractOptionalHeader(req, "X-SSL-Full_Certificate");
return extractOptionalHeader(req, "X-SSL-Full-Certificate");
}
@Provides

View File

@@ -118,10 +118,11 @@ final class TlsCredentialsTest {
tls.validateCertificate(Registrar.loadByClientId("TheRegistrar").get());
}
@Test
void testProvideClientCertificate() {
HttpServletRequest req = mock(HttpServletRequest.class);
when(req.getHeader("X-SSL-Full-Certificate")).thenReturn("data");
assertThat(TlsCredentials.EppTlsModule.provideClientCertificate(req)).isEqualTo("data");
assertThat(TlsCredentials.EppTlsModule.provideClientCertificate(req)).hasValue("data");
}
@Test