-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
4.17.z, 4.18.z, 4.19.z, 4.20.0
-
None
-
Quality / Stability / Reliability
-
False
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description of problem:
The Content-Type response header is not being correctly set with the current encoding, leading to improper decoding by browsers
Version-Release number of selected component (if applicable):
4.18.0-0.nightly-2025-02-28-064241, minikube 1.33.1
How reproducible:
always
Steps to Reproduce:
1. Create test pod in which Chinese character along with some other special character will be printed $ oc new-project test $ oc new-app https://raw.githubusercontent.com/openshift/verification-tests/master/testdata/logging/loggen/container_json_unicode_log_template.json $ POD=$(oc get pods -o json | jq -r .items[0].metadata.name) $ oc logs -f $POD ㄅㄉˇˋㄓˊ˙ㄚㄞㄢㄦㄆ 中国 883.317µs ā á ǎ à ō ó ▅ ▆ ▇ █ 々 ㄅㄉˇˋㄓˊ˙ㄚㄞㄢㄦㄆ 中国 883.317µs ā á ǎ à ō ó ▅ ▆ ▇ █ 々 ㄅㄉˇˋㄓˊ˙ㄚㄞㄢㄦㄆ 中国 883.317µs ā á ǎ à ō ó ▅ ▆ ▇ █ 々 ㄅㄉˇˋㄓˊ˙ㄚㄞㄢㄦㄆ 中国 883.317µs ā á ǎ à ō ó ▅ ▆ ▇ █ 々 ㄅㄉˇˋㄓˊ˙ㄚㄞㄢㄦㄆ 中国 883.317µs ā á ǎ à ō ó ▅ ▆ ▇ █ 々 ㄅㄉˇˋㄓˊ˙ㄚㄞㄢㄦㄆ 中国 883.317µs ā á ǎ à ō ó ▅ ▆ ▇ █ 々 2. Access API server via $ oc proxy $ xdg-open http://localhost:8001/api/v1/namespaces/test/pods/$POD/log?container=centos-logtest 3. Notice that response header Content-Type does not have utf-8 encoding as needed for proper decoding of the content. This results in the log content appearing distorted.
Actual results:
Content-Type HTTP header is text/plain
Expected results:
Content-Type HTTP header should return text/plain;charset=[charset] depending on what charset the pod is using (likely utf-8)
Additional info:
- relates to
-
OCPBUGS-52165 Chinese log messages are garbled at RAW log page
-
- Verified
-