This is a simple demonstration of issue with XMLHttpRequest header. Details are here
Try to run this project and access to endpoint http://localhost:8090/currency?id=KRB with wrong password.
You will receive an error message:
{
"timestamp": 1516089712057,
"status": 401,
"error": "Unauthorized",
"message": "A granted authority textual representation is required",
"path": "/currency"
}
But if you add the header XMLHttpRequest to request, you will not receive any response body messages: