-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
When making XHR requests, can you please set the Accept header? It's currently not set, meaning it defaults to *
Server side frameworks use the Accept header to determine how a request should be handled. For example, Spring Security will return HTTP 401 instead of redirecting to a login page is authentication is required.
I believe that these should be the values for the requests:
/infoshould haveAccept: application/json/xhrshould haveAccept: application/json/xhr_sendshould haveAccept: text/plain/xhr_streamingshould haveAccept: application/javascript/eventsourceshould haveAccept: text/event-stream
In some cases, it's not possible to do set the Accept header (such as when using XDomainRequest, iframes, or jsonp). But it should be set appropriately whenever it is possible.