Remove support for deprecated urn:acme:error prefix

pull/55/head
Richard Körber 2017-02-11 16:26:20 +01:00
parent 76ccb4587c
commit be6b511085
2 changed files with 0 additions and 7 deletions

View File

@ -40,7 +40,6 @@ import org.shredzone.acme4j.exception.AcmeProtocolException;
public final class AcmeUtils {
private static final char[] HEX = "0123456789abcdef".toCharArray();
private static final String ACME_ERROR_PREFIX = "urn:ietf:params:acme:error:";
private static final String ACME_ERROR_PREFIX_DEPRECATED = "urn:acme:error:";
private static final Pattern DATE_PATTERN = Pattern.compile(
"^(\\d{4})-(\\d{2})-(\\d{2})T"
@ -206,9 +205,6 @@ public final class AcmeUtils {
* Strips the acme error prefix from the error string.
* <p>
* For example, for "urn:ietf:params:acme:error:conflict", "conflict" is returned.
* <p>
* This method also handles the deprecated prefix "urn:acme:error:" that is still in
* use at Let's Encrypt.
*
* @param type
* Error type to strip the prefix from. {@code null} is safe.
@ -217,8 +213,6 @@ public final class AcmeUtils {
public static String stripErrorPrefix(String type) {
if (type != null && type.startsWith(ACME_ERROR_PREFIX)) {
return type.substring(ACME_ERROR_PREFIX.length());
} else if (type != null && type.startsWith(ACME_ERROR_PREFIX_DEPRECATED)) {
return type.substring(ACME_ERROR_PREFIX_DEPRECATED.length());
} else {
return null;
}

View File

@ -238,7 +238,6 @@ public class AcmeUtilsTest {
@Test
public void testStripErrorPrefix() {
assertThat(stripErrorPrefix("urn:ietf:params:acme:error:unauthorized"), is("unauthorized"));
assertThat(stripErrorPrefix("urn:acme:error:deprecated"), is("deprecated"));
assertThat(stripErrorPrefix("urn:somethingelse:error:message"), is(nullValue()));
assertThat(stripErrorPrefix(null), is(nullValue()));
}