Skip to content

Commit

Permalink
Merge pull request #14 from chriscareycode/firefox-fix
Browse files Browse the repository at this point in the history
Firefox unable to establish WebSocket connection to MantisAPI
  • Loading branch information
jeffchao authored Aug 18, 2020
2 parents 764e193 + e7e83f5 commit 1ce4f51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/io/mantisrx/api/push/MantisSSEHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ private boolean isTunnelPingsEnabled(String uri) {

private boolean isWebsocketUpgrade(HttpRequest request) {
HttpHeaders headers = request.headers();
return "Upgrade".equalsIgnoreCase(headers.get(HttpHeaderNames.CONNECTION)) &&
"WebSocket".equalsIgnoreCase(headers.get(HttpHeaderNames.UPGRADE));
// Header "Connection" contains "upgrade" (case insensitive) and
// Header "Upgrade" equals "websocket" (case insensitive)
return headers.get(HttpHeaderNames.CONNECTION).toLowerCase().contains("upgrade") &&
headers.get(HttpHeaderNames.UPGRADE).toLowerCase().equals("websocket");
}


Expand Down

0 comments on commit 1ce4f51

Please sign in to comment.