diff --git a/README.md b/README.md index 8cf70135..dcf230be 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ for easy development of WebSocket applications.Eclipse Tyrus is also a Jakarta WebSocket 2.0 compatible implementation. WebSocket protocol defined by IETF -provides bi-directional communication between the server and the remote host. The +provides bidirectional communication between the server and the remote host. The pros are mainly the ability to communicate both ways, low latency and small -communication overhead. Therefore Tyrus and WebSocket in general are suitable for web +communication overhead. Therefore, Tyrus and WebSocket in general are suitable for web applications that require sending a huge volume of relatively small messages like online games or market ticker broadcasting. @@ -20,6 +20,15 @@ online games or market ticker broadcasting. Building Tyrus can be done using `mvn clean install`, but sometimes (such as for building 2.x from a tag) `mvn clean install -Pstaging` would be required. +## Tyrus Git Branches + +| branch | Jakarta Version | Tyrus Version | +|--------|---------------------------------|---------------| +| master | Java EE 8 / Jakarta EE 8 branch | Tyrus 1.x | +| 2.0.x | Jakarta EE 9 branch | Tyrus 2.0.x | +| 2.1.x | Jakarta EE 10 branch | Tyrus 2.1.x | +| 2.x | Jakarta EE 11 branch | Tyrus 2.2.x | + ## Licensing - [Eclipse Public License 2.0](https://projects.eclipse.org/license/epl-2.0) diff --git a/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java b/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java index 78d8a8c3..b787e389 100644 --- a/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java +++ b/client/src/test/java/org/glassfish/tyrus/client/TyrusClientEngineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -443,6 +443,11 @@ public void setReasonPhrase(String reason) { } + @Override + public String getReasonPhrase() { + return null; + } + @Override public Map> getHeaders() { headers.put(HandshakeResponse.SEC_WEBSOCKET_ACCEPT, Collections.singletonList(serverKey)); @@ -468,6 +473,11 @@ public void setReasonPhrase(String reason) { } + @Override + public String getReasonPhrase() { + return null; + } + @Override public Map> getHeaders() { return headers; diff --git a/containers/grizzly-client/src/main/java/org/glassfish/tyrus/container/grizzly/client/GrizzlyClientFilter.java b/containers/grizzly-client/src/main/java/org/glassfish/tyrus/container/grizzly/client/GrizzlyClientFilter.java index d1e892e7..5c6ae378 100644 --- a/containers/grizzly-client/src/main/java/org/glassfish/tyrus/container/grizzly/client/GrizzlyClientFilter.java +++ b/containers/grizzly-client/src/main/java/org/glassfish/tyrus/container/grizzly/client/GrizzlyClientFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -396,6 +396,7 @@ private static UpgradeResponse getUpgradeResponse(HttpResponsePacket httpRespons } tyrusUpgradeResponse.setStatus(httpResponsePacket.getStatus()); + tyrusUpgradeResponse.setReasonPhrase(httpResponsePacket.getReasonPhrase()); return tyrusUpgradeResponse; } diff --git a/containers/grizzly-server/src/main/java/org/glassfish/tyrus/container/grizzly/server/GrizzlyServerFilter.java b/containers/grizzly-server/src/main/java/org/glassfish/tyrus/container/grizzly/server/GrizzlyServerFilter.java index 6e2473f9..e8b7091a 100644 --- a/containers/grizzly-server/src/main/java/org/glassfish/tyrus/container/grizzly/server/GrizzlyServerFilter.java +++ b/containers/grizzly-server/src/main/java/org/glassfish/tyrus/container/grizzly/server/GrizzlyServerFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -281,6 +281,9 @@ private void write(FilterChainContext ctx, UpgradeResponse response) { ((HttpRequestPacket) ((HttpContent) ctx.getMessage()).getHttpHeader()).getResponse(); responsePacket.setProtocol(Protocol.HTTP_1_1); responsePacket.setStatus(response.getStatus()); + if (response.getReasonPhrase() != null) { + responsePacket.setReasonPhrase(response.getReasonPhrase()); + } // TODO // responsePacket.setReasonPhrase(response.getReasonPhrase()); diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java index 90dd8880..70d39ece 100644 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusUpgradeResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -52,10 +52,13 @@ public int getStatus() { /** * Get HTTP reason phrase. + *

+ * Warning: The Reason Phrase is removed from HTTP/2 and from Servlet 6. + *

* * @return reason phrase. */ -// @Override + @Override public String getReasonPhrase() { return reasonPhrase; } diff --git a/pom.xml b/pom.xml index 37cb86c2..6deb6035 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@