Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
fixed header processing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
denyso-bb committed Dec 14, 2023
1 parent 09524ee commit e22e654
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public ResponseEntity<Void> emitEvent(HttpServletRequest request, @RequestBody R
eventEmitterConfiguration.getCustomHeaderPairs()
.stream()
.filter(customHeaderPairs ->
Collections.list(ofNullable(request.getHeaderNames()).orElse(emptyEnumeration())).contains(customHeaderPairs.http()))
Collections.list(ofNullable(request.getHeaderNames()).orElse(emptyEnumeration()))
.stream()
.anyMatch(headerNames -> headerNames.equalsIgnoreCase(customHeaderPairs.http())))
.forEach(customHeaderPairs ->
eventMessageBuilder.setHeader(customHeaderPairs.event(), request.getHeader(customHeaderPairs.http())));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void initialize(ConfigurableApplicationContext configurableApplicationCon
"spring.cloud.stream.bindings.consumeTestEvent-in-0.group=event-emitter",
"spring.cloud.stream.bindings.consumeTestEvent-in-0.destination=" + EVENT_DESTINATION,
"spring.cloud.stream.function.definition=consumeTestEvent",
"backbase.event-emitter.custom-header-pairs[0].http=X-LOB",
"backbase.event-emitter.custom-header-pairs[0].http=x-lob",
"backbase.event-emitter.custom-header-pairs[0].event=bbLineOfBusiness",
"backbase.event-emitter.custom-header-pairs[1].http=customerCategory",
"backbase.event-emitter.custom-header-pairs[1].event=customerEventCategory")
Expand Down

0 comments on commit e22e654

Please sign in to comment.