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

Convert status checking to include all good statuses #164

Open
Timothy-Gonzalez opened this issue Jan 23, 2024 · 0 comments
Open

Convert status checking to include all good statuses #164

Timothy-Gonzalez opened this issue Jan 23, 2024 · 0 comments

Comments

@Timothy-Gonzalez
Copy link
Member

Timothy-Gonzalez commented Jan 23, 2024

Right now, you guys are checking explicitly for status code to be 200. There are other status codes, that while less common, are still "good" statuses. For example, SuccessCreated is 201, SuccessNoContent is 204.

The proper check is res.statusCode < 200 || res.statusCode >= 300. I think there's also some library call to do this automatically for you.

I could only find this check in 3 places, but it might elsewhere:

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

No branches or pull requests

1 participant