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

Set Accept header for XHR requests #540

Closed
candrews opened this issue Apr 2, 2021 · 14 comments · May be fixed by #542
Closed

Set Accept header for XHR requests #540

candrews opened this issue Apr 2, 2021 · 14 comments · May be fixed by #542

Comments

@candrews
Copy link

candrews commented Apr 2, 2021

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 have Accept: application/json
  • /xhr should have Accept: application/json
  • /xhr_send should have Accept: text/plain
  • /xhr_streaming should have Accept: application/javascript
  • /eventsource should have Accept: 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.

@github-actions
Copy link

github-actions bot commented May 6, 2021

This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity.

@candrews
Copy link
Author

candrews commented May 6, 2021

@brycekahle can you please take a look at this?

@github-actions
Copy link

github-actions bot commented Jun 6, 2021

This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity.

@candrews
Copy link
Author

candrews commented Jun 6, 2021

bump

@github-actions
Copy link

github-actions bot commented Jul 8, 2021

This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity.

@candrews
Copy link
Author

candrews commented Jul 8, 2021

bump

@github-actions
Copy link

github-actions bot commented Aug 8, 2021

This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity.

@candrews
Copy link
Author

candrews commented Aug 8, 2021

bump

@github-actions
Copy link

github-actions bot commented Sep 9, 2021

This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity.

@candrews
Copy link
Author

candrews commented Sep 9, 2021

bump

@github-actions
Copy link

This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity.

@candrews
Copy link
Author

bump

@github-actions
Copy link

This issue has been inactive for 30 days. It will be in closed in 5 days without any new activity.

@candrews
Copy link
Author

bump

@github-actions github-actions bot closed this as completed Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants