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 CHANGED
@@ -6,7 +6,7 @@ import { GraphTypes, SPTypes } from "./sptypes";
6
6
  * SharePoint REST Library
7
7
  */
8
8
  export const $REST = {
9
- __ver: 9.79,
9
+ __ver: 9.80,
10
10
  AppContext: (siteUrl) => { return Lib.Site.getAppContext(siteUrl); },
11
11
  Apps: Lib.Apps,
12
12
  ContextInfo: Lib.ContextInfo,
@@ -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 rate limit information exists
47
- if (this.xhr == null || this.getResponseHeader("RateLimit-Limit") == null) {
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; }