Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpHealthIndicator.responseCheck does not work when status is >400 #1944

Closed
2 of 4 tasks
BrunnerLivio opened this issue Jul 15, 2022 · 1 comment
Closed
2 of 4 tasks

Comments

@BrunnerLivio
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Given the following example:

this.http.responseCheck(
          'nestjs-docs',
          'http://localhost:3000/api/',
          (res) => {
            return res.status === 403;
          },
        ),

It will return the following result

{
    "status": "error",
    "info": {},
    "error": {
        "nestjs-docs": {
            "status": "down",
            "message": "Request failed with status code 403",
            "statusCode": 403,
            "statusText": "Forbidden"
        }
    },
    "details": {
        "nestjs-docs": {
            "status": "down",
            "message": "Request failed with status code 403",
            "statusCode": 403,
            "statusText": "Forbidden"
        }
    }
}

Even if the request itself to localhost:3000/api returns 403

Minimum reproduction code

this.http.responseCheck(
          'nestjs-docs',
          'http://localhost:3000/api/',
          (res) => {
            return res.status === 403;
          },
        ),

Steps to reproduce

No response

Expected behavior

It should at least handle the third paramter callback

Package version

9.0.0

NestJS version

No response

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@BrunnerLivio
Copy link
Member Author

Released with 9.1.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant