I was looking into SOLR-8213 [1] and found that HttpSolrClient can swallow
401 unauthorized when the following line 516 evaluates to true:

processor == null || processor instanceof InputStreamResponseParser

I think that in the httpStatus switch there should be a check for 401 and
bail out sooner. It looks like the 401 is only propagated when the mime
types don't match by chance on line 530. I think adding a case to the
switch like below would be more explicit and not cause processing to
continue.

case HttpStatus.SC_UNAUTHORIZED:
  throw new RemoteSolrException(baseUrl, httpStatus,
IOUtils.toString(respBody, "UTF-8"), null);

Is there any issue with this approach?

[1] https://issues.apache.org/jira/browse/SOLR-8213

Kevin Risden
Hadoop Tech Lead | Avalon Consulting, LLC <http://www.avalonconsult.com/>
M: 732 213 8417
LinkedIn <http://www.linkedin.com/company/avalon-consulting-llc> | Google+
<http://www.google.com/+AvalonConsultingLLC> | Twitter
<https://twitter.com/avalonconsult>

-------------------------------------------------------------------------------------------------------------
This message (including any attachments) contains confidential information
intended for a specific individual and purpose, and is protected by law. If
you are not the intended recipient, you should delete this message. Any
disclosure, copying, or distribution of this message, or the taking of any
action based on it, is strictly prohibited.

Reply via email to