Skip to content

bug: Encoding Issue: Original GBK encoding misrecognized as Unicode (UTF-8) after reverse proxying through APISIX, leading to garbled text. #10267

@scoolor

Description

@scoolor

Current Behavior

I encountered an issue where the Content-Type in the HTTP header is being modified after being reverse proxied through APISIX version 3.2. Before proxying, the Content-Type is text/html, but after passing through the proxy, it becomes Content-Type: text/html; charset=utf-8.

This modification in the Content-Type header leads the browser to misrecognize the original GBK encoding as Unicode (UTF-8), resulting in garbled text on the web page.

Would appreciate it if you could provide a resolution or any guidance on how to prevent APISIX from modifying the original Content-Type in the HTTP header, or specifically, from adding the charset=utf-8 attribute.

Please find below the details of the HTTP headers before and after proxying through APISIX:

Before Proxying:

Content-Type: text/html

After Proxying through APISIX (v3.2):

Content-Type: text/html; charset=utf-8

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

Environment

  • APISIX version (run apisix version):3.2
  • Operating system (run uname -a):debian
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions