From 618f94699b5ccd1ffabd845e4e610e83db7681cf Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 2 Aug 2016 13:49:54 +0100 Subject: [PATCH 1/5] Document the optional parameter for specifying a filename to download an attachment as --- api/client-server/content-repo.yaml | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/api/client-server/content-repo.yaml b/api/client-server/content-repo.yaml index 408ee05c..6b879051 100644 --- a/api/client-server/content-repo.yaml +++ b/api/client-server/content-repo.yaml @@ -96,6 +96,46 @@ paths: type: file tags: - Media + "/download/{serverName}/{mediaId}/{fileName}" + get: + summary: "Download content from the content repository as a given filename." + produces: ["*/*"] + parameters: + - in: path + type: string + name: serverName + x-example: matrix.org + required: true + description: | + The server name from the ``mxc://`` URI (the authoritory component) + - in: path + type: string + name: mediaId + x-example: ascERGshawAWawugaAcauga + required: true + description: | + The media ID from the ``mxc://`` URI (the path component) + - in: path + type: string + name: fileName + x-example: filename.jpg + requrired: true + description: + The filename to give in the Content-Disposition + responses: + 200: + description: "The content that was previously uploaded." + headers: + Content-Type: + description: "The content type of the file that was previously uploaded." + type: "string" + Content-Disposition: + description: "The name of file given in the request" + type: "string" + schema: + type: file + tags: + - Media "/thumbnail/{serverName}/{mediaId}": get: summary: "Download a thumbnail of the content from the content repository." From d2fe2f1ff6c2f9a58be8189cbb7f6882fde95877 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 2 Aug 2016 13:59:46 +0100 Subject: [PATCH 2/5] Fix jenkins --- api/client-server/content-repo.yaml | 6 +++--- api/client-server/pushrules.yaml | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/client-server/content-repo.yaml b/api/client-server/content-repo.yaml index 6b879051..f9c92a0d 100644 --- a/api/client-server/content-repo.yaml +++ b/api/client-server/content-repo.yaml @@ -96,7 +96,7 @@ paths: type: file tags: - Media - "/download/{serverName}/{mediaId}/{fileName}" + "/download/{serverName}/{mediaId}/{fileName}": get: summary: "Download content from the content repository as a given filename." produces: ["*/*"] @@ -119,8 +119,8 @@ paths: type: string name: fileName x-example: filename.jpg - requrired: true - description: + required: true + description: | The filename to give in the Content-Disposition responses: 200: diff --git a/api/client-server/pushrules.yaml b/api/client-server/pushrules.yaml index 939150fe..0ba8d481 100644 --- a/api/client-server/pushrules.yaml +++ b/api/client-server/pushrules.yaml @@ -286,7 +286,8 @@ paths: ], "pattern": "cake*lie", "rule_id": "nocake", - "enabled": true + "enabled": true, + "default": false } schema: type: object From f55bf46c7c7bb6a6533d43eea33d8c77657c4e65 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 2 Aug 2016 14:09:36 +0100 Subject: [PATCH 4/5] Print the git revision in jenkins.sh --- jenkins.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jenkins.sh b/jenkins.sh index c58ad473..6c5f650a 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -1,5 +1,7 @@ #! /bin/bash +git rev-parse --abbrev-ref HEAD 2>/dev/null; git describe --exact-match 2>/dev/null; git rev-parse --short HEAD 2>/dev/null; + set -ex (cd event-schemas/ && ./check_examples.py) @@ -15,3 +17,4 @@ go get gopkg.in/fsnotify.v1 (cd scripts/continuserv && go build) (cd scripts/speculator && go build) + From ba64d9fe5aabe0e6c69c691e2d4644a8e12b1ede Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 2 Aug 2016 14:18:55 +0100 Subject: [PATCH 5/5] Remove thing from jenkins.sh --- jenkins.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/jenkins.sh b/jenkins.sh index 6c5f650a..717e8644 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -1,7 +1,5 @@ #! /bin/bash -git rev-parse --abbrev-ref HEAD 2>/dev/null; git describe --exact-match 2>/dev/null; git rev-parse --short HEAD 2>/dev/null; - set -ex (cd event-schemas/ && ./check_examples.py)