We should provide a default, in case of this header is missing. I guess you could do something like:
```java
String charset = Objects.firstNonNull(request.getHeader("Accept-Charset"), "UTF-8");
return charset.split(",")[0];
```