shred / acme4j

Java client for ACME (Let's Encrypt)

Home Page:https://acme4j.shredzone.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

response is not reading correctly

emirhannaneli opened this issue · comments

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);
}

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

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

Thanks ^^

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