Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty routeRoles in wsBeforeUpgrade if it is a websocket route #2171

Closed
yaskor opened this issue Mar 1, 2024 · 4 comments
Closed

Empty routeRoles in wsBeforeUpgrade if it is a websocket route #2171

yaskor opened this issue Mar 1, 2024 · 4 comments

Comments

@yaskor
Copy link

yaskor commented Mar 1, 2024

Actual behavior (the bug)

I have implemented a wsBeforeUpgrade handler. When the handler is executed and I try to access the routeRoles, I always get an empty list even though I have specified roles.

Expected behavior
When the handler is called, one should be able to access the routeRoles that have been defined instead of getting an empty list.

To Reproduce

        config.router.apiBuilder(() -> {
            ws("/ws/client", wsConfig -> {
                wsConfig.onConnect(this::onConnect);
                wsConfig.onMessage(this::onMessage);
                wsConfig.onError(this::onError);
                wsConfig.onClose(this::onClose);
            }, AUTHENTICATED); //<- routeRole is defined
        });
        ).wsBeforeUpgrade(context -> {
            var routeRoles = context.routeRoles();
            //routeRoles <- are empty
        })
@tipsy
Copy link
Member

tipsy commented Mar 1, 2024

Thanks @yaskor, I'll have a look in the weekend!

@tipsy
Copy link
Member

tipsy commented Mar 1, 2024

#2173

@tipsy
Copy link
Member

tipsy commented Mar 2, 2024

Should be fixed now!

@tipsy tipsy closed this as completed Mar 2, 2024
@yaskor
Copy link
Author

yaskor commented Mar 2, 2024

Great! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants