[API] Upload template gives 401 Unauthorized if Accept header is application/json #1251
Open
2 tasks done
Labels
bug
Something isn't working
Before reporting an issue
Environment information
JDK 11
Last docker-composer
Steps to reproduce
Expected behavior
If the Accept content type is not supported, something like 406 Not Acceptable should be returned.
Actual result
401 Unauthorized is returned, but that status has nothing to do with EHRBASE not supporting the content type in the Accept header.
Also found an inconsistency: when uploading the same template twice and the second response is 409 Conflict, it actually returns a JSON response, which kinds of contradicts not supporting an Accept: application/json header. If the endpoint returns JSON, then the Accept:application/json should be accepted. Otherwise the error object should be serialized in another format, like application/xml instead of JSON.
Further information
Note: the inconsistency for the response content type happens when there is a Prefer: return=representation header in the request. If that is not in the request, then the response error is XML.
The text was updated successfully, but these errors were encountered: