gd-sprest 9.8.0 → 9.8.1
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 +16 -5
- 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
|
@@ -34,7 +34,22 @@ export class XHRRequest {
|
|
|
34
34
|
// Flag indicating the request has completed
|
|
35
35
|
get completedFl() { return this.xhr ? this.xhr.readyState == 4 : false; }
|
|
36
36
|
// Gets a response header
|
|
37
|
-
getResponseHeader(key) {
|
|
37
|
+
getResponseHeader(key) {
|
|
38
|
+
// Ensure the a response exists
|
|
39
|
+
if (this.xhr == null) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
// See if the xml http request was used
|
|
43
|
+
if (this.xhr.getResponseHeader) {
|
|
44
|
+
return this.xhr.getResponseHeader(key);
|
|
45
|
+
}
|
|
46
|
+
// See if the fetch command was used
|
|
47
|
+
if (this.xhr["headers"]) {
|
|
48
|
+
return this.xhr["headers"].get(key);
|
|
49
|
+
}
|
|
50
|
+
// Return null by default
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
38
53
|
// The response
|
|
39
54
|
get response() { return this.xhr ? this.xhr.response : null; }
|
|
40
55
|
// The xml http request
|
|
@@ -43,10 +58,6 @@ export class XHRRequest {
|
|
|
43
58
|
get requestData() { return this.targetInfo.requestData; }
|
|
44
59
|
// Return the rate limit information
|
|
45
60
|
get rateLimit() {
|
|
46
|
-
// Ensure the a response exists
|
|
47
|
-
if (this.xhr == null || this.xhr.getResponseHeader == null) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
61
|
// Return the rate limit information
|
|
51
62
|
return this.getResponseHeader("RateLimit-Limit") ? {
|
|
52
63
|
limit: this.getResponseHeader("RateLimit-Limit"),
|