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

Http requests to content-negotiated API endpoints fail on Firefox #6354

Closed
johnrbaur opened this issue Jan 8, 2016 · 4 comments · Fixed by #12989
Closed

Http requests to content-negotiated API endpoints fail on Firefox #6354

johnrbaur opened this issue Jan 8, 2016 · 4 comments · Fixed by #12989

Comments

@johnrbaur
Copy link

http://plnkr.co/edit/FamsVu1O3MxShrQIyMCy?p=preview

We investigated this and found that the default "Accept" header is different between Firefox and Chrome.

Chrome defaults to: "*/*"
Firefox defaults to: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"

Angular 1 handled this for us. With Angular 2, we're required to modify the headers to request JSON or accept the server default.

@wjke
Copy link

wjke commented Sep 2, 2016

8 Jan and still not fixed...
yep kozel retard

@vicb
Copy link
Contributor

vicb commented Sep 27, 2016

In what is this an Angular issue ?

What solution do you propose ?

@johnrbaur
Copy link
Author

I know it's not literally an Angular issue, but one of the great things about frameworks like Angular (or the polyfills underneath them) is how they abstract away many kinds of browser differences. It would be great if the Angular Http service also abstracted away the different browser AJAX behaviors.

My proposed solution is to set the default headers for the Http requests consistently across all browsers.

The AngularJS default is Accept: application/json, text/plain, * / *. This worked consistently across browsers.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants