Closed
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:
/info
should haveAccept: application/json
/xhr
should haveAccept: application/json
/xhr_send
should haveAccept: text/plain
/xhr_streaming
should haveAccept: application/javascript
/eventsource
should 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.