Skip to content

Commit

Permalink
Avoid StringIndexOutOfBoundsException in KafkaRuntimeConfigProducer
Browse files Browse the repository at this point in the history
Fixes quarkusio#40677

(cherry picked from commit 46b1e27)
  • Loading branch information
gsmet committed Jun 4, 2024
1 parent 427d111 commit a0e04e6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public Map<String, Object> createKafkaRuntimeConfig(Config config, ApplicationCo
if (!propertyNameLowerCase.startsWith(CONFIG_PREFIX) || propertyNameLowerCase.startsWith(UI_CONFIG_PREFIX)) {
continue;
}
if (propertyNameLowerCase.length() <= CONFIG_PREFIX.length()) {
continue;
}
// Replace _ by . - This is because Kafka properties tend to use . and env variables use _ for every special
// character. So, replace _ with .
String effectivePropertyName = propertyNameLowerCase.substring(CONFIG_PREFIX.length() + 1).toLowerCase()
Expand Down

0 comments on commit a0e04e6

Please sign in to comment.