diff --git a/jetty-ee10/jetty-ee10-websocket/jetty-ee10-websocket-jetty-server/src/main/java/org/eclipse/jetty/ee10/websocket/server/internal/UpgradeHttpServletRequest.java b/jetty-ee10/jetty-ee10-websocket/jetty-ee10-websocket-jetty-server/src/main/java/org/eclipse/jetty/ee10/websocket/server/internal/UpgradeHttpServletRequest.java index e83473013d2..e917ec4079f 100644 --- a/jetty-ee10/jetty-ee10-websocket/jetty-ee10-websocket-jetty-server/src/main/java/org/eclipse/jetty/ee10/websocket/server/internal/UpgradeHttpServletRequest.java +++ b/jetty-ee10/jetty-ee10-websocket/jetty-ee10-websocket-jetty-server/src/main/java/org/eclipse/jetty/ee10/websocket/server/internal/UpgradeHttpServletRequest.java @@ -419,7 +419,8 @@ public class UpgradeHttpServletRequest implements HttpServletRequest { if (request == null) attributes.put(name, value); - request.setAttribute(name, value); + else + request.setAttribute(name, value); } @Override @@ -427,7 +428,8 @@ public class UpgradeHttpServletRequest implements HttpServletRequest { if (request == null) attributes.remove(name); - request.removeAttribute(name); + else + request.removeAttribute(name); } @Override