gerlowskija commented on code in PR #2496:
URL: https://github.com/apache/solr/pull/2496#discussion_r1627529271
##########
solr/core/src/java/org/apache/solr/handler/api/V2ApiUtils.java:
##########
@@ -87,13 +88,14 @@ public static void squashIntoNamedListWithoutHeader(
squashObjectIntoNamedList(destination, toSquash, true);
}
- public static String getMediaTypeFromWtParam(
- SolrQueryRequest solrQueryRequest, String defaultMediaType) {
- final String wtParam = solrQueryRequest.getParams().get(WT);
- if (wtParam == null) return "application/json";
+ public static String getMediaTypeFromWtParam(SolrParams params, String
defaultMediaType) {
+ final String wtParam = params.get(WT);
+ if (StrUtils.isBlank(wtParam)) return defaultMediaType;
// The only currently-supported response-formats for JAX-RS v2 endpoints.
switch (wtParam) {
+ case "json":
Review Comment:
Yeah, I had this thought as I was adding the case. A map would be a bit
cleaner, especially as we add new content-types.
I'll leave it as-is for now, and switch it over the next time we add a
content-type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]