Skip to content

Commit

Permalink
fix: change regex for content-type checking to also allow media-type …
Browse files Browse the repository at this point in the history
…params (#24)

* fix: fix regex for content-type checking to also allow media-type params

* fix: make content-type regex a bit less restrictive
  • Loading branch information
mherwig authored Jan 23, 2025
1 parent c382b5a commit 6616bed
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ private Map<String, FilterEventMessageWrapper> getFilteredEventMessagesPerRecipi
JsonNode jsonEventDataOrNull = null;

var dataContentType = publishedEventMessage.getEvent().getDataContentType();
var jsonMediaTypeRegexPattern = Pattern.compile("^application/(?:[a-zA-Z0-9]+\\+)?json$", Pattern.CASE_INSENSITIVE);
var jsonMediaTypeRegexPattern = Pattern.compile("^application/(?:[a-zA-Z0-9]+\\+)?json.*", Pattern.CASE_INSENSITIVE);

if (eventData != null && (dataContentType == null || jsonMediaTypeRegexPattern.matcher(dataContentType.trim()).matches())) {
jsonEventDataOrNull = parseEventData(eventData);
Expand Down

0 comments on commit 6616bed

Please sign in to comment.