diff --git a/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java b/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java index 4a42e9ce..f10bcc9c 100755 --- a/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java +++ b/core/src/main/java/org/glassfish/tyrus/core/TyrusEndpointWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 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 @@ -752,11 +752,16 @@ Session onConnect(TyrusWebSocket socket, UpgradeRequest upgradeRequest, String s throw collector.composeComprehensiveException(); } + final TyrusConfiguration tyrusConfiguration = ((RequestContext) upgradeRequest).getTyrusConfiguration(); + final EndpointConfig endpointConfig = configuration instanceof ServerEndpointConfig + ? new ServerEndpointConfigWrapper((ServerEndpointConfig) configuration, tyrusConfiguration.userProperties()) + : configuration; + if (programmaticEndpoint) { - ((Endpoint) toCall).onOpen(session, configuration); + ((Endpoint) toCall).onOpen(session, endpointConfig); } else { try { - onOpen.invoke(toCall, session, configuration); + onOpen.invoke(toCall, session, endpointConfig); } catch (InvocationTargetException e) { throw e.getCause(); } diff --git a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/userproperties/WSProgramaticUserPropertiesServer.java b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/userproperties/WSProgramaticUserPropertiesServer.java index 1c0a58f8..f95a3a17 100644 --- a/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/userproperties/WSProgramaticUserPropertiesServer.java +++ b/tests/e2e/standard-config/src/test/java/org/glassfish/tyrus/test/standard_config/userproperties/WSProgramaticUserPropertiesServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation. + * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -68,6 +68,8 @@ private void checkKey(Map map, String key) { public void onOpen(Session session, EndpointConfig config) { this.session = session; session.addMessageHandler(this); + checkKey(config.getUserProperties(), UserPropertiesConfigurator.KEY_3); + checkKey(config.getUserProperties(), UserPropertiesConfigurator.KEY_4); } @Override