From 568543ab39e238f6ffdac5b0a356d86bad2ae493 Mon Sep 17 00:00:00 2001 From: lda Date: Sat, 9 Dec 2023 21:57:37 +0100 Subject: [PATCH] [FIX+META] Write changelog and enforce GET on RoomAliases --- docs/CHANGELOG.md | 6 ++++++ src/Routes/RouteRoomAliases.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 8ab1b23..dc84eed 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -41,6 +41,8 @@ will now be maintained separately and have its own releases as well. custom scripts. - Greatly simplified some endpoint code by using Cytoplasm's `j2s` for parsing request bodies. +- Create a parser API for grammars found in Matrix, and refactor the +User API to use it. ### New Features @@ -58,6 +60,10 @@ the ability to change only a subset of the configuration. - **GET** `/_telodendria/admin/tokens/[token]` - **POST** `/_telodendria/admin/tokens` - **DELETE** `/_telodendria/admin/tokens/[token]` + - **GET** `/_matrix/client/v3/directory/room/[alias]` + - **PUT** `/_matrix/client/v3/directory/room/[alias]` + - **DELETE** `/_matrix/client/v3/directory/room/[alias]` + - **GET** `/_matrix/client/v3/rooms/[id]/aliases` ## v0.3.0 diff --git a/src/Routes/RouteRoomAliases.c b/src/Routes/RouteRoomAliases.c index 13dbe4b..2fa97bf 100644 --- a/src/Routes/RouteRoomAliases.c +++ b/src/Routes/RouteRoomAliases.c @@ -50,6 +50,14 @@ ROUTE_IMPL(RouteRoomAliases, path, argp) User *user = NULL; + if (HttpRequestMethodGet(args->context) != HTTP_GET) + { + msg = "Route only accepts GET."; + HttpResponseStatus(args->context, HTTP_FORBIDDEN); + response = MatrixErrorCreate(M_FORBIDDEN, msg); + goto finish; + } + response = MatrixGetAccessToken(args->context, &token); if (response) {