Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rolinh opened this issue Jan 21, 2018 · 2 comments
Closed

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

rolinh opened this issue Jan 21, 2018 · 2 comments

Comments

@rolinh
Copy link

rolinh commented Jan 21, 2018

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.

@nadouani
Copy link
Contributor

Another solution could be: calling the API correctly, without the useless Content-Type header since this GET APIs, exposed by TheHive, don't accept any content.

@rolinh
Copy link
Author

rolinh commented Jan 22, 2018

Yeah, sure.

@rolinh rolinh closed this as completed Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants