@sanity/client 6.1.0 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs +2 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +2 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/http/request.ts +2 -1
- package/src/types.ts +2 -2
- package/umd/sanityClient.js +2 -1
- package/umd/sanityClient.min.js +1 -1
package/dist/index.browser.cjs
CHANGED
|
@@ -119,7 +119,8 @@ function defineHttpRequest(envMiddleware, _ref) {
|
|
|
119
119
|
}
|
|
120
120
|
function shouldRetry(err, attempt, options) {
|
|
121
121
|
const isSafe = options.method === "GET" || options.method === "HEAD";
|
|
122
|
-
const
|
|
122
|
+
const uri = options.uri || options.url;
|
|
123
|
+
const isQuery = uri.startsWith("/data/query");
|
|
123
124
|
const isRetriableResponse = err.response && (err.response.statusCode === 429 || err.response.statusCode === 502 || err.response.statusCode === 503);
|
|
124
125
|
if ((isSafe || isQuery) && isRetriableResponse) return true;
|
|
125
126
|
return middleware.retry.shouldRetry(err, attempt, options);
|