Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-60965

Pod logs does not send correct Content-Type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 4.17.z, 4.18.z, 4.19.z, 4.20.0
    • Node / Kubelet
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 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:

       

              harpatil@redhat.com Harshal Patil
              rh-ee-jaclee Jackson Lee
              None
              None
              Mallapadi Niranjan Mallapadi Niranjan
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: