Skip to content

Content type is incorrectly set (breaks request body searches via elasticsearch-transport-wares servlet) #109

@tstibbs

Description

@tstibbs

In my system http is disabled on every elasticsearch node. The only way to access the rest interface is via a webapp which uses the elasticsearch-transport-wares servlet to expose the rest interface. This way, I can lock down access to the rest interface using traditional j2ee authentication.

When I do a request body search using head, it sends a POST with json as the body, but doesn't set the content type - so jquery defaults it to application/x-www-form-urlencoded; charset=UTF-8. This is incorrect, it presumably should be application/json.

This causes an issue because tomcat (I haven't tested other web containers yet) drops the body because it isn't form encoded, so when elasticsearch tries to decode the body, there's no body for it to use. Thus, all searches end up being treated as empty, which elasticsearch assumes means 'match_all'.

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