Skip to content

Conversation

@jsuchal
Copy link
Contributor

@jsuchal jsuchal commented Oct 4, 2013

This fixes a serious issue when sending GET requests to Curb transport backend. Basically request body was discarded and not used at all. For example any search would yield default search - returning all docs.

This fixes a serious issue when sending GET requests to Curb transport backend. Basically request body was discarded and not used at all. For example any search would yield default search - returning all docs.
@jsuchal
Copy link
Contributor Author

jsuchal commented Oct 4, 2013

Seems that the TravisCI builds are failing randomly on testcases i've never touched, not sure if this is my fault.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HEAD requests are supported with Curb, right, why disable them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DELETE requests are supported with Curb, just not without body. We need to do more acrobatics here, and check if the request has a body (eg. delete_by_query), then raise an exception, otherwise perform a DELETE request.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karmi I've not disabled HEAD I've just moved the actual request call down - see line 31. However DELETE with body seems to be still a problem. I am curious why the tests are green - I suppose curb transport is not tested in integration suite right?

This fix exploits put_data= in Curl::Easy to allow request body for GET, DELETE requests.
@jsuchal
Copy link
Contributor Author

jsuchal commented Oct 5, 2013

I've managed to exploit put_data= method to allow request body for all request types. A test run against full test:integration specs in elasticsearch-api using curb transport is green now.

Oh, and Curl::Easy.http uses an upcase symbol. That was really nasty.

@karmi karmi closed this in 8b22af4 Oct 10, 2013
@jsuchal jsuchal deleted the fix-curb-get-with-body branch October 10, 2013 09:11
rafayqayyum pushed a commit to rafayqayyum/elasticsearch-ruby that referenced this pull request Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants