Coder Social home page Coder Social logo

Comments (9)

karmi avatar karmi commented on May 18, 2024

Seems to be specific to the Curb based transport... Will look into it.

from elasticsearch-ruby.

karmi avatar karmi commented on May 18, 2024

The culprit is obviously 80c48dd

from elasticsearch-ruby.

mikebaldry avatar mikebaldry commented on May 18, 2024

That would be a good guess... curl response from the call to GET /_aliases does return as application/json so should be ok.

should the code be looking for Content-Type, not content-type in the headers hash?

from elasticsearch-ruby.

karmi avatar karmi commented on May 18, 2024

should the code be looking for Content-Type, not content-type in the headers hash?

Good catch! Faraday "normalizes" the header like this, but obviously the Curb transport doesn't go through that...

from elasticsearch-ruby.

karmi avatar karmi commented on May 18, 2024

This seems to be the problem:

client = ::Curl::Easy.new
=> #<Curl::Easy>

client.url = 'http://localhost:9200'
=> "http://localhost:9200"

client.http(:get)
=> true

client.header_str
=> "HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=UTF-8\r\nContent-Length: 311\r\n\r\n"

client.headers
=> {}

from elasticsearch-ruby.

karmi avatar karmi commented on May 18, 2024

Related: taf2/curb#184

from elasticsearch-ruby.

mikebaldry avatar mikebaldry commented on May 18, 2024

it looks like #headers is for setting headers on the request, not getting them from the response

from elasticsearch-ruby.

karmi avatar karmi commented on May 18, 2024

Yes, but in any case seems like there's no version of headers parsed as a Hash in Curb yet.

Let's add the check for client.header_str =~ /\/json/ in https://github.com/elasticsearch/elasticsearch-ruby/blob/master/elasticsearch-transport/lib/elasticsearch/transport/transport/http/curb.rb#L31.

from elasticsearch-ruby.

karmi avatar karmi commented on May 18, 2024

Closed in ecfe780

from elasticsearch-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.