gd-sprest 9.7.9 → 9.8.0
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/build/rest.js +1 -1
- package/build/utils/xhrRequest.js +4 -4
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +1 -1
package/build/rest.js
CHANGED
|
@@ -43,16 +43,16 @@ export class XHRRequest {
|
|
|
43
43
|
get requestData() { return this.targetInfo.requestData; }
|
|
44
44
|
// Return the rate limit information
|
|
45
45
|
get rateLimit() {
|
|
46
|
-
// Ensure the
|
|
47
|
-
if (this.xhr == null || this.getResponseHeader
|
|
46
|
+
// Ensure the a response exists
|
|
47
|
+
if (this.xhr == null || this.xhr.getResponseHeader == null) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
// Return the rate limit information
|
|
51
|
-
return {
|
|
51
|
+
return this.getResponseHeader("RateLimit-Limit") ? {
|
|
52
52
|
limit: this.getResponseHeader("RateLimit-Limit"),
|
|
53
53
|
remaining: parseInt(this.getResponseHeader("RateLimit-Remaining")),
|
|
54
54
|
reset: parseInt(this.getResponseHeader("RateLimit-Reset"))
|
|
55
|
-
};
|
|
55
|
+
} : null;
|
|
56
56
|
}
|
|
57
57
|
// The request headers
|
|
58
58
|
get requestHeaders() { return this.headers; }
|