Skip to content

[Bug][api] connection config test api changed upstream 404 error to 400 #7000

Description

@leric

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Connection config test api used to report user friendly error message in release-0.20, e.g. a suggestion for correct url for 404 error, wrong user name and password for 401 error.
After update to 0.21 it returns raw error message from upstream, and status code become 400, even upstream error is 404 or 401.

v0.20
img_v3_028b_795cef11-db80-4fb2-8724-0f6886bca99g

v0.21
img_v3_028b_cbda0a1e-10cb-4f9f-afa6-5211bf0dbd0g

What do you expect to happen

Same behavior as release-0.20

How to reproduce

Test a invalid connection options with plugin connection test api (invalid endpoint):

curl -X 'POST' \
  'http://localhost:4000/plugins/jira/test' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "authMethod": "BasicAuth",
  "endpoint": "https://merico.atlassian.net/st",
  "password": "string",
  "proxy": "",
  "rateLimitPerHour": 11110,
  "username": "lianghui.zhang@merico.dev"
}'

Anything else

No response

Version

v0.21

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThis issue is a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions