Skip to content

org.apache.tomcat.websocket.WsSession.requestUri can be null [SPR-15721] #20277

Closed
@spring-projects-issues

Description

@spring-projects-issues

Artem Bilan opened SPR-15721 and commented

The recent change to the StandardWebSocketSession via #20276, particularly the code:

@Override
public URI getUri() {
	Assert.state(this.uri != null, "WebSocket session is not yet initialized");
	return this.uri;
}

Produces the problem on the client side when we have, according org.apache.tomcat.websocket.WsSession JavaDocs:

* @param requestUri           The URI used to connect to this endpoint or
*                             <code>null</code> is this is a client session

Therefore that Assert has to be removed.

At the same time I'm not pretty sure how we may have it like:

@Nullable
private URI uri;

and say that it can't be null in the getUri().

Thanks


Affects: 5.0 RC3

Issue Links:

Referenced from: commits 9afce23

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions