From 8c553b9625cea57f8245f144a89249e759129152 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 26 Jul 2017 13:16:31 +0100 Subject: [PATCH] StaticModule: Only attempt to parse polygerrit parameter on GET Attempting to parse parameters on POST/PUT fails with BadMessageException. This occurs for example when making any POST/PUT request to the REST API via the command line. Bug: Issue 6853 Change-Id: I774f1d41b040d2f283804f0394654530e1138cbb --- .../src/main/java/com/google/gerrit/httpd/raw/StaticModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java index d0d905de73..87cb3287e1 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java @@ -491,7 +491,7 @@ public class StaticModule extends ServletModule { private boolean handlePolyGerritParam(HttpServletRequest req, HttpServletResponse res) throws IOException { - if (!options.enableGwtUi()) { + if (!options.enableGwtUi() || !"GET".equals(req.getMethod())) { return false; } boolean redirect = false;