Skip to content

AWS Elasticsearch does not accept application/x-ldjson #20

Description

@garrickstapleszed

When talking to AWS Elasticsearch: Error occurred while preparing to ship data: { [Error: Content-Type header [application/x-ldjson] is not supported]. This is with elasticsearch.js 11.0.1.

application/json works fine. It's just a question of how to get lambda-stash to do it. I tried changing shipElasticsearch.js to set the headers, but it didn't work:

var esConfig = {
    host: config.elasticsearch.host,
    requestTimeout: config.elasticsearch.requestTimeout,
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    }
  };

For now, I've modified the bottom of node_modules/elasticsearch/src/lib/serializers/json.js to use application/json.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions