mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 03:57:51 +02:00
Fix typo in header name in Client Certificate Provider (#946)
* Fix typo in header name * fix test
This commit is contained in:
parent
a3537447ef
commit
ad8bc05877
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue