Skip to content

Commit

Permalink
Uncomment assertion for context propagation
Browse files Browse the repository at this point in the history
Closes gh-342
  • Loading branch information
rstoyanchev committed Apr 12, 2022
1 parent 218b16e commit dbba8b1
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,9 @@ public void afterHandshake(
public Closeable restoreThreadLocalValue(WebSocketSession session) {
if (this.accessor != null) {
Map<String, Object> valuesMap = (Map<String, Object>) session.getAttributes().get(SAVED_CONTEXT_KEY);
// Uncomment when Boot is updated to use HandshakeInterceptor
// Assert.state(valuesMap != null, "No context");
if (valuesMap != null) {
this.accessor.restoreValues(valuesMap);
return () -> this.accessor.resetValues(valuesMap);
}
Assert.state(valuesMap != null, "No ThreadLocal context in WebSocketSession attributes");
this.accessor.restoreValues(valuesMap);
return () -> this.accessor.resetValues(valuesMap);
}
return () -> {};
}
Expand Down

0 comments on commit dbba8b1

Please sign in to comment.