Skip to content

Commit

Permalink
SOLR-16723: Http2SolrClient should not use Apache Http client classes (
Browse files Browse the repository at this point in the history
  • Loading branch information
risdenk committed Mar 29, 2023
1 parent 33ee6f2 commit 2e6715a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Bug Fixes

* SOLR-16638: Fix Http2SolrClient's exception message when serverBaseUrl is null (Alex Deparvu via Kevin Risden)

* SOLR-16723: Http2SolrClient should not use Apache Http client classes (Kevin Risden)

Dependency Upgrades
---------------------
* PR#1494: Upgrade forbiddenapis to 3.5 (Uwe Schindler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import org.apache.http.entity.ContentType;
import org.apache.solr.client.solrj.ResponseParser;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest;
Expand Down Expand Up @@ -922,13 +921,15 @@ private void checkContentType(
if (processorSupportedContentTypes != null && !processorSupportedContentTypes.isEmpty()) {
boolean processorAcceptsMimeType =
processorSupportedContentTypes.stream()
.map(ct -> ContentType.parse(ct).getMimeType().trim())
.map(ct -> MimeTypes.getContentTypeWithoutCharset(ct).trim())
.anyMatch(mimeType::equalsIgnoreCase);
if (!processorAcceptsMimeType) {
// unexpected mime type
final String allSupportedTypes =
processorSupportedContentTypes.stream()
.map(ct -> ContentType.parse(ct).getMimeType().trim().toLowerCase(Locale.ROOT))
.map(
ct ->
MimeTypes.getContentTypeWithoutCharset(ct).trim().toLowerCase(Locale.ROOT))
.collect(Collectors.joining(", "));
String prefix =
"Expected mime type in [" + allSupportedTypes + "] but got " + mimeType + ". ";
Expand Down Expand Up @@ -1309,7 +1310,7 @@ public void setParser(ResponseParser parser) {
protected void updateDefaultMimeTypeForParser() {
defaultParserMimeTypes =
parser.getContentTypes().stream()
.map(ct -> ContentType.parse(ct).getMimeType().trim().toLowerCase(Locale.ROOT))
.map(ct -> MimeTypes.getContentTypeWithoutCharset(ct).trim().toLowerCase(Locale.ROOT))
.collect(Collectors.toSet());
}

Expand Down

0 comments on commit 2e6715a

Please sign in to comment.