From 7cc15f331554e7e329d396275ba2c8f256d7a43f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 27 May 2018 12:34:58 -0600 Subject: [PATCH 1/2] Document the allow_remote query param on the media repo Fixes https://github.com/matrix-org/matrix-doc/issues/837 Signed-off-by: Travis Ralston --- api/client-server/content-repo.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/api/client-server/content-repo.yaml b/api/client-server/content-repo.yaml index 03a25fd9..f76b2fb9 100644 --- a/api/client-server/content-repo.yaml +++ b/api/client-server/content-repo.yaml @@ -95,6 +95,15 @@ paths: required: true description: | The media ID from the ``mxc://`` URI (the path component) + - in: query + type: boolean + name: allow_remote + x-example: false + required: false + description: | + Indicates to the server that it should not attempt to fetch the media if it is deemed + remote. This is to prevent routing loops where the server contacts itself. Defaults to + true if not provided. responses: 200: description: "The content that was previously uploaded." @@ -140,6 +149,15 @@ paths: required: true description: | The filename to give in the Content-Disposition + - in: query + type: boolean + name: allow_remote + x-example: false + required: false + description: | + Indicates to the server that it should not attempt to fetch the media if it is deemed + remote. This is to prevent routing loops where the server contacts itself. Defaults to + true if not provided. responses: 200: description: "The content that was previously uploaded." @@ -198,6 +216,15 @@ paths: name: method x-example: "scale" description: The desired resizing method. + - in: query + type: boolean + name: allow_remote + x-example: false + required: false + description: | + Indicates to the server that it should not attempt to fetch the media if it is deemed + remote. This is to prevent routing loops where the server contacts itself. Defaults to + true if not provided. responses: 200: description: "A thumbnail of the requested content." From 8cbd80265085c7d0726b380525b08b1699d34af2 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sun, 27 May 2018 12:36:50 -0600 Subject: [PATCH 2/2] Add allow_remote to the changelog Signed-off-by: Travis Ralston --- changelogs/client_server.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelogs/client_server.rst b/changelogs/client_server.rst index 3c4fbffa..422c3e2d 100644 --- a/changelogs/client_server.rst +++ b/changelogs/client_server.rst @@ -48,6 +48,8 @@ Unreleased changes (`#1142 `_). - Add the ``/register/available`` endpoint for username availability (`#1151 `_). + - Add ``allow_remote`` to the content repo to avoid routing loops + (`#1265 `_). r0.3.0 ======