From d5686df5c0c075198799b7839d16b168b30c68b6 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Thu, 4 Aug 2022 14:59:15 +0200 Subject: [PATCH 1/2] fixes #146: Limit URI template match for MUC affiliation The fix for issue #141 introduces a template to replace four distinct URL patterns: - `/restapi/v1/chatrooms/{roomName}/owners` - `/restapi/v1/chatrooms/{roomName}/admins` - `/restapi/v1/chatrooms/{roomName}/members` - `/restapi/v1/chatrooms/{roomName}/outcasts` got replaced by - `/restapi/v1/chatrooms/{roomName}/{affiliation}` Sadly, this template matches more than just those four. URLs like these also get caught, making them misbehave: - `/restapi/v1/chatrooms/{roomName}/chathistory` - `/restapi/v1/chatrooms/{roomName}/occupants` - `/restapi/v1/chatrooms/{roomName}/participants` - `/restapi/v1/chatrooms/{roomName}/invite` This commit fixes the problem by applying a regular expression to the `{affiliation}` template, requiring it to match one of four distinct options. --- changelog.html | 5 +++++ .../plugin/rest/service/MUCRoomAffiliationsService.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index f18d3e870..0ccef6fa0 100644 --- a/changelog.html +++ b/changelog.html @@ -44,6 +44,11 @@

REST API Plugin Changelog

+

1.9.1 (tbd)

+ +

1.9.0 August 4, 2022