-
Notifications
You must be signed in to change notification settings - Fork 340
fix: Avoid sending request body with GET (issue #318) #538
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
base: master
Are you sure you want to change the base?
Conversation
|
Could we avoid future regressions by adding a test that fails with the current code but passes with the proposed code? |
The test cases already reference this function. |
|
Adding tests for changes should be the default behavior; so, please avoid pushing back on requests to add tests. If the existing tests covered this case, they would have failed. They currently do not fail, so adding a test helps avoid regressions. |
This completely depends on where we are sending the HTTP network requests. The Apache Solr web backend still has backward compatibility to respond to HTTP GET requests with a request body. Howwever, it recommends using query parameters instead of sending data in the request body. This behavior may be removed in the future (I don't know), and Solr may completely stop reading the body of GET requests. |
Currently, it is not possible to test this because Solr still responds by reading data from the HTTP GET request body. |
|
Any thoughts? @acdha |
|
Looking at this, I'm thinking the answer might be to dub the next major release 4.x. I don't think there's a case where this would break on a version of Solr we still support but that would be a clear signal. We already have a bit of a breaking change it appears because in 11c881e the tests recognize that in the absence of I was already wondering about that because this commit makes me question whether I also noticed that the admin code is calling |
Description
Fixes: Issue#318
This PR fixes an issue where parameters were being sent in the body of a GET request.
GETrequests should not contain a request body.The fix updates the request to pass parameters through the URL query string using
params=, which is what Solr expects.References
CoreAdmin Status API
https://solr.apache.org/guide/solr/9_9/configuration-guide/coreadmin-api.html#coreadmin-status
CoreAdmin Create API
https://solr.apache.org/guide/solr/9_9/configuration-guide/coreadmin-api.html#coreadmin-create
Collections DeleteStatus API
https://solr.apache.org/guide/solr/9_9/configuration-guide/collections-api.html#deletestatus