Skip to content

Fix ClassCastException when adding headers to non-RequestWrapper requ…#430

Open
DanBezalelpx wants to merge 1 commit into
devfrom
fix/de_bug
Open

Fix ClassCastException when adding headers to non-RequestWrapper requ…#430
DanBezalelpx wants to merge 1 commit into
devfrom
fix/de_bug

Conversation

@DanBezalelpx

Copy link
Copy Markdown
Contributor

…ests

The SDK blindly cast HttpServletRequest to RequestWrapper when injecting data enrichment, breached account, and additional S2S activity headers. This caused a ClassCastException for customers using their own HttpServletRequestWrapper implementations.

Introduces addHeaderSafely() which checks instanceof before casting. If the request is not a RequestWrapper, falls back to request.setAttribute() so the data is still accessible to the customer's application.

…ests

The SDK blindly cast HttpServletRequest to RequestWrapper when injecting
data enrichment, breached account, and additional S2S activity headers.
This caused a ClassCastException for customers using their own
HttpServletRequestWrapper implementations.

Introduces addHeaderSafely() which checks instanceof before casting. If
the request is not a RequestWrapper, falls back to request.setAttribute()
so the data is still accessible to the customer's application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant