mirror of https://github.com/shred/acme4j
Use correct rate limit link relation name
parent
efc4a04df4
commit
576a798186
|
@ -483,7 +483,7 @@ public class DefaultConnection implements Connection {
|
||||||
|
|
||||||
if ("rateLimited".equals(error)) {
|
if ("rateLimited".equals(error)) {
|
||||||
Optional<Instant> retryAfter = getRetryAfterHeader();
|
Optional<Instant> retryAfter = getRetryAfterHeader();
|
||||||
Collection<URL> rateLimits = getLinks("urn:ietf:params:acme:documentation");
|
Collection<URL> rateLimits = getLinks("help");
|
||||||
throw new AcmeRateLimitedException(problem, retryAfter.orElse(null), rateLimits);
|
throw new AcmeRateLimitedException(problem, retryAfter.orElse(null), rateLimits);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -504,7 +504,7 @@ public class DefaultConnectionTest {
|
||||||
String jsonData = "{\"type\":\"urn:ietf:params:acme:error:rateLimited\",\"detail\":\"Too many invocations\"}";
|
String jsonData = "{\"type\":\"urn:ietf:params:acme:error:rateLimited\",\"detail\":\"Too many invocations\"}";
|
||||||
|
|
||||||
Map<String, List<String>> linkHeader = new HashMap<>();
|
Map<String, List<String>> linkHeader = new HashMap<>();
|
||||||
linkHeader.put("Link", Arrays.asList("<https://example.com/rates.pdf>; rel=\"urn:ietf:params:acme:documentation\""));
|
linkHeader.put("Link", Arrays.asList("<https://example.com/rates.pdf>; rel=\"help\""));
|
||||||
|
|
||||||
Instant retryAfter = Instant.now().plusSeconds(30L).truncatedTo(ChronoUnit.MILLIS);
|
Instant retryAfter = Instant.now().plusSeconds(30L).truncatedTo(ChronoUnit.MILLIS);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue