Skip to content

Commit 7067461

Browse files
committed
Fix exception in Jetty10RequestUpgradeStrategy
Closes gh-27899
1 parent 34cb5df commit 7067461

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/socket/server/upgrade/Jetty10RequestUpgradeStrategy.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -149,7 +149,7 @@ public WebSocketCreatorInterceptor(
149149
public Object invoke(@NonNull MethodInvocation invocation) {
150150
if (this.protocol != null) {
151151
ReflectionUtils.invokeMethod(
152-
setAcceptedSubProtocol, invocation.getArguments()[2], this.protocol);
152+
setAcceptedSubProtocol, invocation.getArguments()[1], this.protocol);
153153
}
154154
return this.adapter;
155155
}

spring-websocket/src/main/java/org/springframework/web/socket/server/jetty/Jetty10RequestUpgradeStrategy.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -158,7 +158,7 @@ public WebSocketCreatorInterceptor(
158158
public Object invoke(@NonNull MethodInvocation invocation) {
159159
if (this.protocol != null) {
160160
ReflectionUtils.invokeMethod(
161-
setAcceptedSubProtocol, invocation.getArguments()[2], this.protocol);
161+
setAcceptedSubProtocol, invocation.getArguments()[1], this.protocol);
162162
}
163163
return this.adapter;
164164
}

0 commit comments

Comments
 (0)