Skip to content

Invalid mediatype with compatible-with throws exception #79060

@pgomulka

Description

@pgomulka

when an invalid media type is used on content-type or Accept header but with compatible-with parameter an exception is thrown which is not handled and emits a WARN log message
nothing is returned to a server

reproduce:

curl --request PUT \
  --url 'http://localhost:9200/my_index1?include_type_name=true' \
  --header 'Accept: aaa/bbb' \
  --header 'Authorization: Basic ZWxhc3RpYzpwYXNzd29yZA==' \
  --header 'Content-Type: aaa/bbb;compatible-with=7' \
  --data '{
    "mappings": {
        "type1": {
            "properties": {
                "location": {
                    "type": "geo_shape"
                }
            }
        }
    }
}'

we should handle this exception and return something meaning full to a user

I have a feeling that it might have been discussed already. @jakelandis @joegallo do you remember? any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions