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

Remove charset=utf-8 parameter from withJson() method #2629

Closed
l0gicgate opened this issue Apr 15, 2019 · 0 comments · Fixed by #2630
Closed

Remove charset=utf-8 parameter from withJson() method #2629

l0gicgate opened this issue Apr 15, 2019 · 0 comments · Fixed by #2630

Comments

@l0gicgate
Copy link
Member

l0gicgate commented Apr 15, 2019

As per IANA notes on media types https://www.iana.org/assignments/media-types/application/json the charset parameter has no effect on the content type application/json.

A user reported that Chrome started throwing CORB (Cross-Origin-Read-Blocking) warnings when the content type was set to application/json; charset=utf-8

We need to remove ; charset=utf-8 from Response::withJson()
https://github.com/slimphp/Slim/blob/8e43e5d0e2882fc70b23265e402072bbd686c2bb/Slim/Http/Response.php

Looking for a new contributor to raise a PR for this.

@l0gicgate l0gicgate added this to the 3.13.0 milestone Apr 15, 2019
l0gicgate added a commit that referenced this issue Apr 15, 2019
Remove `; charset=utf-8` from Response::withJson()

Closes #2629
jelhan added a commit to jelhan/croodle that referenced this issue Oct 30, 2019
Charset was removed from Content-Type intentionally. See slimphp/Slim#2629 for reasons.
jelhan added a commit to jelhan/croodle that referenced this issue Oct 30, 2019
Charset was removed from Content-Type intentionally. See slimphp/Slim#2629 for reasons.
jelhan added a commit to jelhan/croodle that referenced this issue Oct 30, 2019
Charset was removed from Content-Type intentionally in latest slim 3.x version. See slimphp/Slim#2629 for reasons.

Ensure that composer respects our PHP support commitment.
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.

1 participant