shred / acme4j

Java client for ACME (Let's Encrypt)
https://acme4j.shredzone.org
Apache License 2.0
509 stars 93 forks source link

response is not reading correctly #156

Closed emirhannaneli closed 6 months ago

emirhannaneli commented 6 months ago

The locale parameter is required when the toUpperCase method is used in the parsing method of the org.shredzone.acme4j.Status class. Otherwise it becomes UNKNOWN

Currently

public static Status parse(String str) {
        String check = str.toUpperCase();
        return (Status)Arrays.stream(values()).filter((s) -> {
            return s.name().equals(check);
        }).findFirst().orElse(UNKNOWN);
 }

Suggested

public static Status parse(String str) {
        String check = str.toUpperCase(Locale.ENGLISH);
        return (Status)Arrays.stream(values()).filter((s) -> {
            return s.name().equals(check);
        }).findFirst().orElse(UNKNOWN);
}
shred commented 6 months ago

Good catch! Thank you, I will fix that for the next version.

emirhannaneli commented 6 months ago

Good catch! Thank you, I will fix that for the next version.

Thanks ^^

shred commented 6 months ago

Fixed in acme4j 3.2.1. It's available in the release section and soon on Maven Central. Thanks again!