Entitlement verification: Not perform verification if request returns error#840
Conversation
| val verificationResult = if (shouldSignResponse && | ||
| nonce != null && | ||
| RCHTTPStatusCodes.isSuccessful(responseCode) | ||
| ) { |
There was a problem hiding this comment.
Note that this means for 400/500s we will return NOT_VERIFIED as verification result. I believe this shouldn't matter since the code that handles errors later on will not let it be handled as a success, but I thought I would mention it.
Codecov Report
@@ Coverage Diff @@
## entitlements-verification #840 +/- ##
============================================================
Coverage ? 82.62%
============================================================
Files ? 137
Lines ? 4500
Branches ? 586
============================================================
Hits ? 3718
Misses ? 562
Partials ? 220 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
| val verificationResult = if (shouldSignResponse && nonce != null) { | ||
| val verificationResult = if (shouldSignResponse && | ||
| nonce != null && | ||
| RCHTTPStatusCodes.isSuccessful(responseCode) |
There was a problem hiding this comment.
This is skipping it for 304s too, is that intended?
There was a problem hiding this comment.
Hmm this is only filtering 4xx/5xx error codes actually. Lmk if I missed something though
There was a problem hiding this comment.
Oh ok, I was just looking at how isSuccessful is defined in iOS not in Android 👍🏻
… error (#840) ### Description We were performing signature verification when the request failed with 400/500 errors. We don't need to verify those requests since it will fail anyway. Network errors were already handled since they throw an exception that is catched later on.
Description
We were performing signature verification when the request failed with 400/500 errors. We don't need to verify those requests since it will fail anyway. Network errors were already handled since they throw an exception that is catched later on.