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

Properly process requests that have invalid MUC service or room references #101

Merged
merged 1 commit into from May 30, 2022

Conversation

guusdk
Copy link
Member

@guusdk guusdk commented May 11, 2022

When requests are made against MUC services or rooms that do not exist (but are expected to), then the old implementation would return a HTTP 500 "Internal Server Error" response.

This commit explicitly checks if the MUC service/room that is used in the request exist, and return HTTP 404 "Not Found" when that's not the case.

I've also included more annotations that will cause Swagger to generate a more complete list of errors that are returned for MUC services.

this fixes #74

@Fishbowler
Copy link
Member

Worth a couple of unit tests to prove and retain the behaviour?

…ences

When requests are made against MUC services or rooms that do not exist (but are expected to), then the old implementation would return a HTTP 500 "Internal Server Error" response.

This commit explicitly checks if the MUC service/room that is used in the request exist, and return HTTP 404 "Not Found" when that's not the case.

I've also included more annotations that will cause Swagger to generate a more complete list of errors that are returned for MUC services.

this fixes igniterealtime#74
@guusdk
Copy link
Member Author

guusdk commented May 11, 2022

Worth a couple of unit tests to prove and retain the behaviour?

I briefly looked at that, but that might not be very easy or representative. In the current setup, we'd basically replace the thing that generates the tests now with a mock, which kind of defeats the purpose of the test.

@guusdk guusdk merged commit baccf89 into igniterealtime:main May 30, 2022
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

Successfully merging this pull request may close these issues.

NPE when passing incorrect MUC service name
2 participants