-
Notifications
You must be signed in to change notification settings - Fork 637
Description
Version: spring cloud function 5.0.1
when message header specversion is byte[] instead of string then a ClassCastException is thrown:
java.lang.ClassCastException: class [B cannot be cast to class java.lang.String ([B and java.lang.String are in module java.base of loader 'bootstrap')
at org.springframework.cloud.function.cloudevent.CloudEventMessageUtils.determinePrefixToUse(CloudEventMessageUtils.java:382)
at org.springframework.cloud.function.cloudevent.CloudEventMessageUtils.determinePrefixToUse(CloudEventMessageUtils.java:362)
at org.springframework.cloud.function.cloudevent.CloudEventMessageUtils.getType(CloudEventMessageUtils.java:197)
I guess the cause is this line:
if (StringUtils.hasText(prefix) && (strict || StringUtils.hasText((String) messageHeaders.get(prefix + _SPECVERSION)))) {
return prefix;
}
the byte[] case is not handled here.
thx Max