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
In BaseRequest, the only response code handled is 429 (Rate Limit).
Any other code are just ignored and an empty result is returned. If a cache defined, it will poisoning it with an empty value.
If the token is incorrect (or the service has not been renewed on time) will result in silent errors. Same if your service has a glitch and return 5xx error.
As I expect the service would always return 200 in case of success (I assume it will not return 302 or any partial response), any non 200 code could return null and not be stored in the cache.
"Expected" errors like 403 could raise their own exception - probably same for 5xx. I would also add some logging in there.
The text was updated successfully, but these errors were encountered:
tdltdl
pushed a commit
to tdltdl/ipInfojava
that referenced
this issue
Sep 11, 2024
…s with cache poisoning.
WARNING This change is not a drop in replacement as if we get 403 because the token is incorrect, a checked exception is raised.
Also note that, if an empty or null token is passed, it is now a fail fast (instead of getting a null pointer exception at the first request)
In BaseRequest, the only response code handled is 429 (Rate Limit).
Any other code are just ignored and an empty result is returned. If a cache defined, it will poisoning it with an empty value.
If the token is incorrect (or the service has not been renewed on time) will result in silent errors. Same if your service has a glitch and return 5xx error.
As I expect the service would always return 200 in case of success (I assume it will not return 302 or any partial response), any non 200 code could return null and not be stored in the cache.
"Expected" errors like 403 could raise their own exception - probably same for 5xx. I would also add some logging in there.
The text was updated successfully, but these errors were encountered: