Add versioned appservice paths to existing routes

Synapse v1.81 changed to attempt using version paths when calling
an appservice before falling back to the legacy paths. However the
appservice was generating a 404 and the server wouldn't fallback
so this adds the versioned paths to the existing routes.

Resolves #64
This commit is contained in:
Morgan McMillian 2023-05-01 14:18:53 -07:00
parent 782c3d070b
commit a26759bb7b

View file

@ -29,6 +29,7 @@ def forbidden(error):
def shutdown_session(exception=None): def shutdown_session(exception=None):
db_session.remove() db_session.remove()
@app.route("/_matrix/app/v1/rooms/<alias>")
@app.route("/rooms/<alias>") @app.route("/rooms/<alias>")
def query_alias(alias): def query_alias(alias):
alias_localpart = alias.split(":")[0][1:] alias_localpart = alias.split(":")[0][1:]
@ -88,6 +89,7 @@ def query_alias(alias):
return jsonify({}) return jsonify({})
@app.route("/_matrix/app/v1/transactions/<transaction>", methods=["PUT"])
@app.route("/transactions/<transaction>", methods=["PUT"]) @app.route("/transactions/<transaction>", methods=["PUT"])
def on_receive_events(transaction): def on_receive_events(transaction):