Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allow_redirect query parameter to relevant media endpoints #1529

Merged
merged 4 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/client_server/newsfragments/1529.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Addition of redirect downloads, as per [MSC3860](https://github.com/matrix-org/matrix-spec-proposals/pull/3860).
69 changes: 69 additions & 0 deletions data/api/client-server/content-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,17 @@ paths:
content repository can and should impose a maximum value for this
parameter. The content repository may also choose to respond before
the timeout.
- in: query
type: boolean
name: allow_redirect
x-addedInMatrixVersion: "1.7"
x-example: false
required: false
default: false
description: |
Indicates to the server that it may return a 307 or 308 redirect response that points
at the relevant media content. When not explicitly set to true the server must return
the media content itself.
responses:
200:
description: "The content that was previously uploaded."
Expand All @@ -323,6 +334,18 @@ paths:
type: file
# This is a workaround for us not being able to say the response is required.
description: "**Required.** The bytes for the uploaded file."
307:
description: "A redirect to the thumbnail of the requested content."
headers:
Location:
description: "The URL of the thumbnail content."
type: "string"
308:
description: "A redirect to the thumbnail of the requested content."
headers:
Location:
description: "The URL of the thumbnail content."
type: "string"
429:
description: This request was rate-limited.
schema:
Expand Down Expand Up @@ -404,6 +427,17 @@ paths:
content repository can and should impose a maximum value for this
parameter. The content repository may also choose to respond before
the timeout.
- in: query
type: boolean
name: allow_redirect
x-addedInMatrixVersion: "1.7"
x-example: false
required: false
default: false
description: |
Indicates to the server that it may return a 307 or 308 redirect response that points
at the relevant media content. When not explicitly set to true the server must return
the media content itself.
responses:
200:
description: "The content that was previously uploaded."
Expand All @@ -420,6 +454,18 @@ paths:
type: file
# This is a workaround for us not being able to say the response is required.
description: "**Required.** The bytes for the uploaded file."
307:
description: "A redirect to the thumbnail of the requested content."
headers:
Location:
description: "The URL of the thumbnail content."
type: "string"
308:
description: "A redirect to the thumbnail of the requested content."
headers:
Location:
description: "The URL of the thumbnail content."
type: "string"
429:
description: This request was rate-limited.
schema:
Expand Down Expand Up @@ -518,6 +564,17 @@ paths:
content repository can and should impose a maximum value for this
parameter. The content repository may also choose to respond before
the timeout.
- in: query
type: boolean
name: allow_redirect
x-addedInMatrixVersion: "1.7"
x-example: false
required: false
default: false
description: |
Indicates to the server that it may return a 307 or 308 redirect response that points
at the relevant media content. When not explicitly set to true the server must return
the media content itself.
responses:
200:
description: "A thumbnail of the requested content."
Expand All @@ -530,6 +587,18 @@ paths:
type: file
# This is a workaround for us not being able to say the response is required.
description: "**Required.** The bytes for the thumbnail."
307:
description: "A redirect to the thumbnail of the requested content."
headers:
Location:
description: "The URL of the thumbnail content."
type: "string"
308:
description: "A redirect to the thumbnail of the requested content."
headers:
Location:
description: "The URL of the thumbnail content."
type: "string"
400:
description: |-
The request does not make sense to the server, or the server cannot thumbnail
Expand Down
Loading