Skip to content

Commit

Permalink
Merge pull request #1694 from RakhithaRR/AI-5359
Browse files Browse the repository at this point in the history
Fix inconsistent behaviour with the preserved headers
  • Loading branch information
RakhithaRR authored Jan 26, 2024
2 parents a87a0d9 + b763f37 commit 23299c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ public WebSocketClientHandler cacheNewConnection(final String tenantDomain,
handler = new WebSocketClientHandler(WebSocketClientHandshakerFactory.newHandshaker(uri,
WebSocketVersion.V13,
deriveSubprotocol(wsSubprotocol, contentType),
false, defaultHttpHeaders, maxLength));
false, defaultHttpHeaders, maxLength, true, false, -1L, false, false));
} else {
handler = new WebSocketClientHandler(WebSocketClientHandshakerFactory.newHandshaker(uri,
WebSocketVersion.V13,
deriveSubprotocol(wsSubprotocol, contentType),
false, defaultHttpHeaders));
false, defaultHttpHeaders, 65536, true, false, -1L, false, false));
}
handler.setCorrelationId(correlationId);
handler.setApiProperties(apiProperties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public void sendMessage(MessageContext msgCtx, String targetEPR, OutTransportInf
String preservableHeaders = preserveWebSocketHeadersParameter.getValue().toString();
for (String header : preservableHeaders.split(",")) {
Object headerValue = msgCtx.getProperty(header);
Iterator<String> headerNames = msgCtx.getPropertyNames();
while (headerValue == null && headerNames.hasNext()) {
String headerName = headerNames.next();
if (headerName.equalsIgnoreCase(header)) {
headerValue = msgCtx.getProperty(headerName);
}
}
if (headerValue != null) {
customHeaders.put(header, headerValue);
}
Expand Down

0 comments on commit 23299c5

Please sign in to comment.