From b10061bf1117c3262fcbfbec43d724fbfba02d9a Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Mon, 18 Nov 2013 18:19:26 +0000 Subject: [PATCH] SOLR-5452: Parse params correctly. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1543097 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/servlet/SolrDispatchFilter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java index 80c3fd3f2f9..4d1277c6ef9 100644 --- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java +++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java @@ -314,9 +314,9 @@ public class SolrDispatchFilter implements Filter // if we couldn't find it locally, look on other nodes if (core == null && idx > 0) { String coreUrl = getRemotCoreUrl(cores, corename, origCorename); - Map params = req.getParameterMap(); // don't proxy for internal update requests - if (coreUrl != null && (params == null || !params.containsKey(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM))) { + solrReq = SolrRequestParsers.DEFAULT.parse(null,path, req); + if (coreUrl != null && solrReq.getParams().get(DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM) == null) { path = path.substring( idx ); remoteQuery(coreUrl + path, req, solrReq, resp); return; @@ -500,9 +500,9 @@ public class SolrDispatchFilter implements Filter con.setRequestMethod(req.getMethod()); con.setUseCaches(false); - boolean isPostRequest = "POST".equals(req.getMethod()); + boolean isPostOrPutRequest = "POST".equals(req.getMethod()) || "PUT".equals(req.getMethod()); - if (isPostRequest) { + if (isPostOrPutRequest) { con.setDoOutput(true); } con.setDoInput(true); @@ -515,7 +515,7 @@ public class SolrDispatchFilter implements Filter InputStream is; OutputStream os; - if (isPostRequest) { + if (isPostOrPutRequest) { is = req.getInputStream(); os = con.getOutputStream(); // side effect: method is switched to POST try {