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
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:
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
is201
,SuccessNoContent
is204
.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:
site/utils/api.ts
Line 48 in c717b0d
site/utils/api.ts
Line 75 in c717b0d
site/utils/api.ts
Line 135 in c717b0d
The text was updated successfully, but these errors were encountered: