gd-sprest 9.0.9 → 9.1.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/request.js +8 -0
- package/build/utils/targetInfo.js +5 -0
- 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
package/build/utils/request.js
CHANGED
|
@@ -579,6 +579,14 @@ exports.Request = {
|
|
|
579
579
|
}
|
|
580
580
|
// Else, see if the data properties exists
|
|
581
581
|
else if (data.d) {
|
|
582
|
+
// Get the endpoint method to see if it's part of the response
|
|
583
|
+
var endpointInfo = base.targetInfo.endpoint.split('/');
|
|
584
|
+
var endpointMethod = endpointInfo[endpointInfo.length - 1] || "";
|
|
585
|
+
endpointMethod = endpointMethod[0].toUpperCase() + endpointMethod.substring(1);
|
|
586
|
+
if (data.d[endpointMethod]) {
|
|
587
|
+
// Update the response to be that object
|
|
588
|
+
data.d = data.d[endpointMethod];
|
|
589
|
+
}
|
|
582
590
|
// Save a reference to it
|
|
583
591
|
obj["d"] = data.d;
|
|
584
592
|
// Update the metadata
|
|
@@ -36,6 +36,11 @@ var TargetInfo = /** @class */ (function () {
|
|
|
36
36
|
this.props.url || "",
|
|
37
37
|
this.props.endpoint
|
|
38
38
|
].join('/').replace(/\/\//g, '/').replace(/\/$/, '');
|
|
39
|
+
// Fix the url from above, it will remove a '/' from the beginning
|
|
40
|
+
if (this.requestUrl.indexOf("https://") != this.requestUrl.indexOf("https:/")) {
|
|
41
|
+
// Fix the beginning of the url
|
|
42
|
+
this.requestUrl = this.requestUrl.replace("https:/", "https://");
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
46
|
else {
|