"MXC URI" -> "mxc://
URI" (#1500)
* "MXC URI" -> "`mxc://` URI" We're a bit inconsistent with this currently, and IMHO "`mxc://` URI" is more explicit. * Update content/client-server-api/modules/content_repo.md Co-authored-by: Hubert Chathi <hubertc@matrix.org> * more MXCs --------- Co-authored-by: Hubert Chathi <hubertc@matrix.org>
This commit is contained in:
parent
715f6a301d
commit
1f729eef60
12 changed files with 20 additions and 19 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fix various typos throughout the specification.
|
|
@ -7,7 +7,7 @@ user wants to send to a room would be uploaded here, as would an avatar
|
||||||
the user wants to use.
|
the user wants to use.
|
||||||
|
|
||||||
Uploads are POSTed to a resource on the user's local homeserver which
|
Uploads are POSTed to a resource on the user's local homeserver which
|
||||||
returns a MXC URI which can later be used to GET the download. Content
|
returns an `mxc://` URI which can later be used to GET the download. Content
|
||||||
is downloaded from the recipient's local homeserver, which must first
|
is downloaded from the recipient's local homeserver, which must first
|
||||||
transfer the content from the origin homeserver using the same API
|
transfer the content from the origin homeserver using the same API
|
||||||
(unless the origin and destination homeservers are the same).
|
(unless the origin and destination homeservers are the same).
|
||||||
|
@ -23,9 +23,9 @@ When serving content, the server SHOULD provide a
|
||||||
interacting with the media repository.
|
interacting with the media repository.
|
||||||
{{% /boxes/added-in-paragraph %}}
|
{{% /boxes/added-in-paragraph %}}
|
||||||
|
|
||||||
#### Matrix Content (MXC) URIs
|
#### Matrix Content (`mxc://`) URIs
|
||||||
|
|
||||||
Content locations are represented as Matrix Content (MXC) URIs. They
|
Content locations are represented as Matrix Content (`mxc://`) URIs. They
|
||||||
look like:
|
look like:
|
||||||
|
|
||||||
mxc://<server-name>/<media-id>
|
mxc://<server-name>/<media-id>
|
||||||
|
@ -88,10 +88,10 @@ The HTTP GET endpoint does not require any authentication. Knowing the
|
||||||
URL of the content is sufficient to retrieve the content, even if the
|
URL of the content is sufficient to retrieve the content, even if the
|
||||||
entity isn't in the room.
|
entity isn't in the room.
|
||||||
|
|
||||||
MXC URIs are vulnerable to directory traversal attacks such as
|
`mxc://` URIs are vulnerable to directory traversal attacks such as
|
||||||
`mxc://127.0.0.1/../../../some_service/etc/passwd`. This would cause the
|
`mxc://127.0.0.1/../../../some_service/etc/passwd`. This would cause the
|
||||||
target homeserver to try to access and return this file. As such,
|
target homeserver to try to access and return this file. As such,
|
||||||
homeservers MUST sanitise MXC URIs by allowing only alphanumeric
|
homeservers MUST sanitise `mxc://` URIs by allowing only alphanumeric
|
||||||
(`A-Za-z0-9`), `_` and `-` characters in the `server-name` and
|
(`A-Za-z0-9`), `_` and `-` characters in the `server-name` and
|
||||||
`media-id` values. This set of whitelisted characters allows URL-safe
|
`media-id` values. This set of whitelisted characters allows URL-safe
|
||||||
base64 encodings specified in RFC 4648. Applying this character
|
base64 encodings specified in RFC 4648. Applying this character
|
||||||
|
|
|
@ -53,7 +53,7 @@ the tag.
|
||||||
| `font` | `data-mx-bg-color`, `data-mx-color`, `color` |
|
| `font` | `data-mx-bg-color`, `data-mx-color`, `color` |
|
||||||
| `span` | `data-mx-bg-color`, `data-mx-color`, `data-mx-spoiler` (see [spoiler messages](#spoiler-messages)) |
|
| `span` | `data-mx-bg-color`, `data-mx-color`, `data-mx-spoiler` (see [spoiler messages](#spoiler-messages)) |
|
||||||
| `a` | `name`, `target`, `href` (provided the value is not relative and has a scheme matching one of: `https`, `http`, `ftp`, `mailto`, `magnet`) |
|
| `a` | `name`, `target`, `href` (provided the value is not relative and has a scheme matching one of: `https`, `http`, `ftp`, `mailto`, `magnet`) |
|
||||||
| `img` | `width`, `height`, `alt`, `title`, `src` (provided it is a [Matrix Content (MXC) URI](#matrix-content-mxc-uris)) |
|
| `img` | `width`, `height`, `alt`, `title`, `src` (provided it is a [Matrix Content (`mxc://`) URI](#matrix-content-mxc-uris)) |
|
||||||
| `ol` | `start` |
|
| `ol` | `start` |
|
||||||
| `code` | `class` (only classes which start with `language-` for syntax highlighting) |
|
| `code` | `class` (only classes which start with `language-` for syntax highlighting) |
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ When sending a spoiler, clients SHOULD provide the fallback in the `body` as sho
|
||||||
(including the reason). The fallback SHOULD NOT include the text containing spoilers since
|
(including the reason). The fallback SHOULD NOT include the text containing spoilers since
|
||||||
`body` might show up in text-only clients or in notifications. To prevent spoilers showing up in
|
`body` might show up in text-only clients or in notifications. To prevent spoilers showing up in
|
||||||
such situations, clients are strongly encouraged to first upload the text containing spoilers
|
such situations, clients are strongly encouraged to first upload the text containing spoilers
|
||||||
to the media repository, then reference the MXC URI in a markdown-style link, as shown above.
|
to the media repository, then reference the `mxc://` URI in a markdown-style link, as shown above.
|
||||||
|
|
||||||
Clients SHOULD render spoilers differently with some sort of disclosure. For example, the
|
Clients SHOULD render spoilers differently with some sort of disclosure. For example, the
|
||||||
client could blur the actual text and ask the user to click on it for it to be revealed.
|
client could blur the actual text and ask the user to click on it for it to be revealed.
|
||||||
|
|
|
@ -59,7 +59,7 @@ paths:
|
||||||
format: byte
|
format: byte
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: The [MXC URI](/client-server-api/#matrix-content-mxc-uris) for the uploaded content.
|
description: The [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) for the uploaded content.
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
required: ["content_uri"]
|
required: ["content_uri"]
|
||||||
|
@ -67,7 +67,7 @@ paths:
|
||||||
content_uri:
|
content_uri:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
description: "The [MXC URI](/client-server-api/#matrix-content-mxc-uris) to the uploaded content."
|
description: "The [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) to the uploaded content."
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"content_uri": "mxc://example.com/AQwafuaFswefuhsfAFAgsw"
|
"content_uri": "mxc://example.com/AQwafuaFswefuhsfAFAgsw"
|
||||||
|
@ -393,7 +393,7 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
description: |-
|
description: |-
|
||||||
An [MXC URI](/client-server-api/#matrix-content-mxc-uris) to the image. Omitted if there is no image.
|
An [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris) to the image. Omitted if there is no image.
|
||||||
examples:
|
examples:
|
||||||
application/json: {
|
application/json: {
|
||||||
"og:title": "Matrix Blog Post",
|
"og:title": "Matrix Blog Post",
|
||||||
|
|
|
@ -54,7 +54,7 @@ properties:
|
||||||
icon:
|
icon:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
Optional MXC URI to provide an image/icon representing the IdP.
|
Optional `mxc://` URI to provide an image/icon representing the IdP.
|
||||||
Intended to be shown alongside the `name` if provided.
|
Intended to be shown alongside the `name` if provided.
|
||||||
example: "mxc://example.org/abc123"
|
example: "mxc://example.org/abc123"
|
||||||
brand:
|
brand:
|
||||||
|
|
|
@ -297,7 +297,7 @@ paths:
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
description: The mxc avatar url of the user this object is representing.
|
description: The avatar of the user this object is representing, as an [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris).
|
||||||
description: A map from user ID to a RoomMember object.
|
description: A map from user ID to a RoomMember object.
|
||||||
type: object
|
type: object
|
||||||
403:
|
403:
|
||||||
|
|
|
@ -98,7 +98,7 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
example: "mxc://bar.com/foo"
|
example: "mxc://bar.com/foo"
|
||||||
description: The avatar url, as an MXC, if one exists.
|
description: The avatar url, as an [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris), if one exists.
|
||||||
limited:
|
limited:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Indicates if the result list has been truncated by the limit.
|
description: Indicates if the result list has been truncated by the limit.
|
||||||
|
|
|
@ -19,7 +19,7 @@ properties:
|
||||||
type: integer
|
type: integer
|
||||||
thumbnail_url:
|
thumbnail_url:
|
||||||
description: |-
|
description: |-
|
||||||
The URL (typically [MXC URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image.
|
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image.
|
||||||
Only present if the thumbnail is unencrypted.
|
Only present if the thumbnail is unencrypted.
|
||||||
type: string
|
type: string
|
||||||
thumbnail_file:
|
thumbnail_file:
|
||||||
|
|
|
@ -28,7 +28,7 @@ properties:
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
description: |-
|
description: |-
|
||||||
Required if the file is unencrypted. The URL (typically [MXC URI](/client-server-api/#matrix-content-mxc-uris))
|
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
|
||||||
to the audio clip.
|
to the audio clip.
|
||||||
type: string
|
type: string
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -44,7 +44,7 @@ properties:
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
description: |-
|
description: |-
|
||||||
Required if the file is unencrypted. The URL (typically [MXC URI](/client-server-api/#matrix-content-mxc-uris))
|
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
|
||||||
to the file.
|
to the file.
|
||||||
type: string
|
type: string
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -18,7 +18,7 @@ properties:
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
description: |-
|
description: |-
|
||||||
Required if the file is unencrypted. The URL (typically [MXC URI](/client-server-api/#matrix-content-mxc-uris))
|
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
|
||||||
to the image.
|
to the image.
|
||||||
type: string
|
type: string
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -28,7 +28,7 @@ properties:
|
||||||
type: integer
|
type: integer
|
||||||
thumbnail_url:
|
thumbnail_url:
|
||||||
description: |-
|
description: |-
|
||||||
The URL (typically [MXC URI](/client-server-api/#matrix-content-mxc-uris)) to an image thumbnail of
|
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to an image thumbnail of
|
||||||
the video clip. Only present if the thumbnail is unencrypted.
|
the video clip. Only present if the thumbnail is unencrypted.
|
||||||
type: string
|
type: string
|
||||||
thumbnail_file:
|
thumbnail_file:
|
||||||
|
@ -50,7 +50,7 @@ properties:
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
description: |-
|
description: |-
|
||||||
Required if the file is unencrypted. The URL (typically [MXC URI](/client-server-api/#matrix-content-mxc-uris))
|
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
|
||||||
to the video clip.
|
to the video clip.
|
||||||
type: string
|
type: string
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue