commit | 0dea4c5c4f80778ed700d28a96503878bdbd73fa | [log] [tgz] |
---|---|---|
author | Edwin Kempin <edwin.kempin@sap.com> | Thu Nov 21 13:58:36 2013 +0100 |
committer | Edwin Kempin <edwin.kempin@sap.com> | Thu Nov 21 13:58:36 2013 +0100 |
tree | 2dee0d259293a09a1fffafed1fa64c1560622ae2 | |
parent | 1f3d48122532fd66453c2b42bef42780234cbd56 [diff] |
Fix check for username The username in the JSON body is optional, only if it was specified it must match the username from the URL. Change-Id: I1eef312c8dbcf5b20fe7b556e6ca825d99686058 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java index 05f89e9..72af687 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java +++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java
@@ -117,7 +117,7 @@ if (input == null) { input = new Input(); } - if (!username.equals(input.username)) { + if (input.username != null && !username.equals(input.username)) { throw new BadRequestException("username must match URL"); } if (Strings.isNullOrEmpty(input.sshKey)) {