Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-16723: Http2SolrClient should not use Apache Http client classes #1503

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,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