You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Call a method on the client that calls the Datadog API
Observe that the returned response code is a string.
Environment and Versions (please complete the following information):
Using version 1.40 of this client.
The text was updated successfully, but these errors were encountered:
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:
Verify that you can still reproduce the issue in the latest version of this project.
Comment that the issue is still reproducible and include updated details requested in the issue template.
Describe the bug
I think
Net::HTTP
is returning response codes as strings. The call toNet::HTTP.request()
here returns aNet::HTTPResponse
object, which has a stringcode
: 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
204
s 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:
Environment and Versions (please complete the following information):
Using version 1.40 of this client.
The text was updated successfully, but these errors were encountered: