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

Inconsistencies in GET request in ACCEPT header #594

Open
redwanulsourav opened this issue Mar 18, 2023 · 2 comments
Open

Inconsistencies in GET request in ACCEPT header #594

redwanulsourav opened this issue Mar 18, 2023 · 2 comments

Comments

@redwanulsourav
Copy link
Contributor

Not sure if this is accepted behavior or a bug. I found this out when testing the REST API with curl.

For inserting resource, if a GET request is sent to path /<database_name>/<resource_name> with no ACCEPT header set, it by default assumes a JSON database. If <database_name>/<resource_name> is an XML resource, it throws an exception.

The reason might be in GetHandler.kt , lines 98-111.

If this is needs to be updated, then a 400 Bad Request can be set if no ACCEPT header was set in GET handler. Otherwise the issue can be ignored.

@JohannesLichtenberger
Copy link
Member

Bad request would be ideal, yes

@redwanulsourav
Copy link
Contributor Author

Just realized that without bad request handler implemented, it is going to throw an exception no matter how it is handled. I will probably delete this issue and work on the refactorings and the bad request handler.

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