mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-10 00:59:01 +00:00
Ensure StompEncoder never writes content-length twice
Issue: SPR-11984
This commit is contained in:
+5
-1
@@ -112,8 +112,12 @@ public final class StompEncoder {
|
||||
|
||||
for (Entry<String, List<String>> entry : nativeHeaders.entrySet()) {
|
||||
byte[] key = encodeHeaderString(entry.getKey(), shouldEscape);
|
||||
if (command.requiresContentLength() && "content-length".equals(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
List<String> values = entry.getValue();
|
||||
if (StompHeaderAccessor.STOMP_PASSCODE_HEADER.equals(entry.getKey())) {
|
||||
if (StompCommand.CONNECT.equals(command) &&
|
||||
StompHeaderAccessor.STOMP_PASSCODE_HEADER.equals(entry.getKey())) {
|
||||
values = Arrays.asList(StompHeaderAccessor.getPasscode(headers));
|
||||
}
|
||||
for (String value : values) {
|
||||
|
||||
Reference in New Issue
Block a user