You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "dolphinium (via GitHub)" <gi...@apache.org> on 2026/04/16 18:29:07 UTC

[PR] fix(config): accept text/plain content-type in JsonResponseParser [solr-mcp]

dolphinium opened a new pull request, #90:
URL: https://github.com/apache/solr-mcp/pull/90

   > Split out from #89 at maintainer's request — this PR contains only the Content-Type tolerance fix.
   
   ## Summary
   
   Widens `JsonResponseParser#getContentTypes()` to advertise both `application/json` and `text/plain`, so SolrJ stops rejecting otherwise-valid JSON responses that are served with `Content-Type: text/plain`.
   
   ## Motivation
   
   Some Solr request handlers (notably `/admin/ping` and a number of standalone-mode paths) return JSON-encoded bodies with `Content-Type: text/plain`. SolrJ validates the response Content-Type against the set advertised by the configured `ResponseParser` and fails with:
   
   ```
   Expected mime type in [application/json] but got text/plain
   ```
   
   …even though the payload is a valid Solr JSON response. This surfaces to MCP clients through tools like `check-health` and `search` as errors, despite the underlying query succeeding.
   
   Observed end-to-end against a real standalone Solr 9.x instance: `check-health` and `search` both return the error above pre-fix, and return clean results post-fix.
   
   ## Changes
   
   - `JsonResponseParser#getContentTypes`: advertise `application/json` **and** `text/plain`.
   - No behavioural change for handlers that already return `application/json`.
   
   ## Tests
   
   - `JsonResponseParserContentTypesTest` (new): pins the advertised Content-Type set.
   - `./gradlew build` passes locally (Spotless + NullAway + full unit suite).
   
   ## Test plan
   
   - [x] `./gradlew spotlessCheck`
   - [x] `./gradlew build` (unit tests)
   - [x] Manual end-to-end against a standalone Solr 9.x — `check-health` and `search` now succeed on handlers that previously returned `text/plain`.
   
   ## Notes
   
   - No new runtime dependencies.
   - Behaviour is strictly additive (accepting one more Content-Type).
   - Signed off under DCO; commit follows Conventional Commits per `CONTRIBUTING.md`.
   
   Companion PR for the Basic Auth feature: #89
   
   Co-authored-by: Claude <no...@anthropic.com>


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] fix(config): accept text/plain content-type in JsonResponseParser [solr-mcp]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh merged PR #90:
URL: https://github.com/apache/solr-mcp/pull/90


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] fix(config): accept text/plain content-type in JsonResponseParser [solr-mcp]

Posted by "adityamparikh (via GitHub)" <gi...@apache.org>.
adityamparikh commented on PR #90:
URL: https://github.com/apache/solr-mcp/pull/90#issuecomment-4700808283

   Looks good to me. @epugh can you please merge? 


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] fix(config): accept text/plain content-type in JsonResponseParser [solr-mcp]

Posted by "adityamparikh (via GitHub)" <gi...@apache.org>.
adityamparikh commented on PR #90:
URL: https://github.com/apache/solr-mcp/pull/90#issuecomment-4364619076

   Hi! A new PR-validation CI workflow recently landed on `main` (#117). To get this PR's tests evaluated against the new pipeline, could you rebase your branch onto current `main` and push? That will trigger the new `ci.yml` (build / unit / integration). Thanks!


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] fix(config): accept text/plain content-type in JsonResponseParser [solr-mcp]

Posted by "dolphinium (via GitHub)" <gi...@apache.org>.
dolphinium commented on PR #90:
URL: https://github.com/apache/solr-mcp/pull/90#issuecomment-4604163724

   @adityamparikh Rebased both branches(#89 and #90) onto current main — conflicts resolved and ci.yml is now triggering (currently action_required). Could you approve the workflow runs? Thanks!


-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org