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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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