Created
June 27, 2021 11:45
-
-
Save nkalra0123/5aab1a1475f448c999745c21a59dca53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected boolean isWebsocketRequested(IHTTPSession session) { | |
Map<String, String> headers = session.getHeaders(); | |
String upgrade = headers.get(NanoWSD.HEADER_UPGRADE); | |
boolean isCorrectConnection = isWebSocketConnectionHeader(headers); | |
boolean isUpgrade = NanoWSD.HEADER_UPGRADE_VALUE.equalsIgnoreCase(upgrade); | |
return isUpgrade && isCorrectConnection; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment