Skip to content

bug: error message in text/html #12264

Open
@kratosmat

Description

@kratosmat

Current Behavior

Hi all,
I am newbie on apisix, so I hope I am not asking something already discussed.

I noticed that calling some apis via apisix, when there is some error, it send a text/html response, such as 404 or 401 in html format. Now we are using apisix to protect Rest API and we don't expect to have html response.

I think that this shouldn't be the default behaviour, anyway there is a way to configure to have reponses in application/json, or is it a bug?

Thanks a lot,
Matteo.

Expected Behavior

No response

Error Logs

No response

Steps to Reproduce

  1. create a route to http bin
  2. call the api with a wrong context via curl or postman
  3. check the response body and response headers

Environment

  • APISIX version (run apisix version): 3.11.0-debian
  • Operating system (run uname -a): kubernetes image 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): etcd:3.5.10-debian-11-r2
  • 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

    questionlabel for questions asked by users

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions