Skip to content

bug: external-plugin-post-resp plugin converts content-type from upstream response #8388

Description

@seowjin1060

Current Behavior

Bug : external-plugin-post-resp converts reponse content types to plain/text

  • Json response if request sended directly to test api server
    image

  • Encoded to plain/text if request sended via apisix upstream
    image

Steps to Reproduce

Testing with local apisix & test api server env (apisix 3.0.0 on 9080 port , test api server with 8000 port )

Plugin Configuration

{
  "allow_degradation": false,
  "conf":[
    {
       "name": "PostResponseFilter",
       "value": ""
    }
  ],
  "disable": false
}

  • Json response if request sended directly to test api server
    image

  • Encoded to plain/text if request sended via apisix upstream
    image

Cause many type of api servers handled by apisix, some of them don't handle http response with json automatically,

I expecting apisix not to convert response types to text/plain.

Any approach or opinion will be appreciated to fix this problems

Expected Behavior

Content type must be consist after handled by apisix upstream.

Error Logs

This seems to logical problem with apisix core, so no error logs included

Environment

  • APISIX version (run apisix version): 2.99
  • Operating system (run uname -a): RHEL 8
  • OpenResty / Nginx version (run openresty -V or nginx -V): 1.21.4
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info): 3.5.4
  • APISIX Dashboard version, if relevant: 2.13.0
  • Plugin runner version, for issues related to plugin runners: java 17
  • LuaRocks version, for installation issues (run luarocks --version): 5.4.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions