Skip to content

GET request with Content-Type ends up in HTTP 400 #438

Closed
@rolinh

Description

@rolinh

Request Type

Bug

Work Environment

Question Answer
TheHive version 3.0.3

Problem Description

When doing GET requests against the API, if the Content-Type header is provided, the API rejects the request with status 400 and message "Invalid Json: No content to map due to end-of-input".

Example message when a GET request is done against the /api/alert route with the Content-Type header set to application/json:

A client error occurred on GET /api/alert : Invalid Json: No content to map due to end-of-input at [Source: akka.util.ByteIterator$ByteArrayIterator$$anon$1@4491ed16; line: 1, column: 0]

Steps to Reproduce

As explained above, do a GET request with the Content-Type header set to application/json.

Possible Solutions

Answer the request appropriately and ignore data when none is provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions