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

Response codes are handled as integers, but are strings #234

Closed
mikesaelim opened this issue Jun 3, 2020 · 3 comments · Fixed by #254
Closed

Response codes are handled as integers, but are strings #234

mikesaelim opened this issue Jun 3, 2020 · 3 comments · Fixed by #254
Labels
kind/bug Bug related issue stale Stale - Bot reminder

Comments

@mikesaelim
Copy link

mikesaelim commented Jun 3, 2020

Describe the bug
I think Net::HTTP is returning response codes as strings. The call to Net::HTTP.request() here returns a Net::HTTPResponse object, which has a string code: Net::HTTPResponse.

However, it looks like the client handles the response code as if it were an integer, in a number of places. For example, here and here. The FakeResponse in the specs also gets initialized with integer response codes.

If I'm not mistaken, this means 204s and redirects might not be handled properly. If you concur, I'd be willing to submit a PR to fix how the response code is handled.

To Reproduce
Steps to reproduce the behavior:

  1. Call a method on the client that calls the Datadog API
  2. Observe that the returned response code is a string.

Environment and Versions (please complete the following information):
Using version 1.40 of this client.

@mikesaelim mikesaelim added the kind/bug Bug related issue label Jun 3, 2020
@github-actions
Copy link

github-actions bot commented Jul 4, 2020

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale Stale - Bot reminder label Jul 4, 2020
@mikesaelim
Copy link
Author

Yep, it's still like this.

@mikesaelim
Copy link
Author

Thanks @zippolyte !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug related issue stale Stale - Bot reminder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant