-
Notifications
You must be signed in to change notification settings - Fork 5k
fix(templates): not add default charset when upstream response doesn't contain it #9905
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3635200
to
c4c83a1
Compare
c4c83a1
to
b82e49e
Compare
9ca98d8
to
39eabbb
Compare
39eabbb
to
8fa6472
Compare
samugi
approved these changes
Dec 12, 2022
dndx
reviewed
Dec 26, 2022
…t contain it Currently, Kong adds `charset=UTF-8` to `Content-Type` header of response if the content-type is one of `charset_types` and contains no charset. Kong doesn't know the charset of upstream response and can't assume it is UTF-8. Also we shouldn't change the response unless explicitly required e.g. by the response transformer plugin. FTI-4551
Co-authored-by: Datong Sun <datong.sun@konghq.com>
9e993b7
to
d9ee248
Compare
7723103
to
dcfa845
Compare
dndx
approved these changes
Jan 4, 2023
windmgc
pushed a commit
that referenced
this pull request
Jan 13, 2023
…'t provide it (#9905) Currently Kong adds `charset=UTF-8` to `Content-Type` header of response if upstream provided `Content-Type` contains no `charset`. Kong should not be assuming the charset of upstream response is `UTF-8`. Also we shouldn't change the response charset unless explicitly configured by the response transformer plugin. FTI-4551 Co-authored-by: Datong Sun <datong.sun@konghq.com>
bungle
added a commit
that referenced
this pull request
Jan 13, 2023
… configurable ### Summary `charset` directive that was previously hard coded in template with a value of `UTF-8` was removed completely with this PR: #9905 Previous discussion from 3 years ago pointed that this is breaking change (not a fix): #5045 So here is another fix to make the directive still default to `UTF-8`. which is a quite fine default, but allow users to configure it. E.g.: ``` KONG_NGINX_HTTP_CHARSET=off kong start ```
bungle
added a commit
that referenced
this pull request
Jan 16, 2023
… configurable ### Summary `charset` directive that was previously hard coded in template with a value of `UTF-8` was removed completely with this PR: #9905 Previous discussion from 3 years ago pointed that this is breaking change (not a fix): #5045 So here is another fix to make the directive still default to `UTF-8`. which is a quite fine default, but allow users to configure it. E.g.: ``` KONG_NGINX_HTTP_CHARSET=off kong start ```
bungle
added a commit
that referenced
this pull request
Jan 17, 2023
… configurable (#10111) ### Summary `charset` directive that was previously hard coded in template with a value of `UTF-8` was removed completely with this PR: #9905 Previous discussion from 3 years ago pointed that this is breaking change (not a fix): #5045 So here is another fix to make the directive still default to `UTF-8`. which is a quite fine default, but allow users to configure it. E.g.: ``` KONG_NGINX_HTTP_CHARSET=off kong start ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, Kong adds
charset=UTF-8
toContent-Type
header of response if the content-type is one ofcharset_types
and contains no charset.Kong doesn't know the charset of upstream response and can't assume it is UTF-8. Also we shouldn't change the response unless explicitly required e.g. by the response transformer plugin.
FTI-4551