From fd808eb8727d2a5b0199675f8a51181a1542b3ad Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Fri, 29 Nov 2019 11:41:54 +0200 Subject: [PATCH] REST: Fix bad content type description plain/text instead of text/plain Change-Id: I6da9851c0d7416962843ab23794702c0caef95a1 --- Documentation/rest-api-accounts.txt | 2 +- java/com/google/gerrit/sshd/commands/SetAccountCommand.java | 2 +- .../shared/gr-rest-api-interface/gr-rest-api-interface.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/rest-api-accounts.txt b/Documentation/rest-api-accounts.txt index 8247212bfa..c4ece59c4b 100644 --- a/Documentation/rest-api-accounts.txt +++ b/Documentation/rest-api-accounts.txt @@ -791,7 +791,7 @@ key is persisted. .Request ---- POST /accounts/self/sshkeys HTTP/1.0 - Content-Type: plain/text + Content-Type: text/plain AAAAB3NzaC1yc2EAAAABIwAAAQEA0T...YImydZAw\u003d\u003d ---- diff --git a/java/com/google/gerrit/sshd/commands/SetAccountCommand.java b/java/com/google/gerrit/sshd/commands/SetAccountCommand.java index 9bcb1032d1..0ff19f74f1 100644 --- a/java/com/google/gerrit/sshd/commands/SetAccountCommand.java +++ b/java/com/google/gerrit/sshd/commands/SetAccountCommand.java @@ -277,7 +277,7 @@ final class SetAccountCommand extends SshCommand { PermissionBackendException { for (String sshKey : sshKeys) { SshKeyInput in = new SshKeyInput(); - in.raw = RawInputUtil.create(sshKey.getBytes(UTF_8), "plain/text"); + in.raw = RawInputUtil.create(sshKey.getBytes(UTF_8), "text/plain"); addSshKey.apply(rsrc, in); } } diff --git a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js index dd4f04f642..79e3fa8df5 100644 --- a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js +++ b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.js @@ -2668,7 +2668,7 @@ method: 'POST', url: '/accounts/self/sshkeys', body: key, - contentType: 'plain/text', + contentType: 'text/plain', reportUrlAsIs: true, }; return this._send(req)