From 5bbe73747c8fea387c97c79de3917e61b487c646 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 27 Sep 2020 22:23:42 +0100 Subject: [PATCH] unbreak CORS on /capabilities. fixes https://github.com/vector-im/element-web/issues/15297 --- clientapi/routing/routing.go | 2 +- go.mod | 2 ++ syncapi/routing/messages.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 999946a6..ab56c5f4 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -793,7 +793,7 @@ func Setup( } return GetCapabilities(req, rsAPI) }), - ).Methods(http.MethodGet) + ).Methods(http.MethodGet, http.MethodOptions) // Supplying a device ID is deprecated. r0mux.Handle("/keys/upload/{deviceID}", diff --git a/go.mod b/go.mod index ca0c2710..d60fe235 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/matrix-org/dendrite +replace github.com/matrix-org/gomatrixserverlib => ../gomatrixserverlib + require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/Shopify/sarama v1.27.0 diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go index 0999d3e8..6447e5d5 100644 --- a/syncapi/routing/messages.go +++ b/syncapi/routing/messages.go @@ -179,7 +179,7 @@ func OnIncomingMessagesRequest( } } -// retrieveEvents retrieve events from the local database for a request on +// retrieveEvents retrieves events from the local database for a request on // /messages. If there's not enough events to retrieve, it asks another // homeserver in the room for older events. // Returns an error if there was an issue talking to the database or with the