api-def 0.6.2-alpha.4 → 0.6.2-alpha.5
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/cjs/RequestContext.js +5 -4
- package/esm/RequestContext.js +5 -4
- package/package.json +1 -1
package/cjs/RequestContext.js
CHANGED
|
@@ -127,13 +127,14 @@ var RequestContext = /** @class */ (function () {
|
|
|
127
127
|
return this;
|
|
128
128
|
};
|
|
129
129
|
RequestContext.prototype.parseRequestBody = function () {
|
|
130
|
+
var _a;
|
|
130
131
|
if (this.computedConfig.body && this.computedConfig.headers) {
|
|
131
132
|
var contentTypeKey = Object.keys(this.computedConfig.headers).find(function (key) { return key.toLowerCase() === "content-type"; });
|
|
132
|
-
var contentType = contentTypeKey && this.computedConfig.headers[contentTypeKey];
|
|
133
|
-
if (
|
|
133
|
+
var contentType = contentTypeKey && ((_a = this.computedConfig.headers[contentTypeKey]) === null || _a === void 0 ? void 0 : _a.toString());
|
|
134
|
+
if (contentType === "application/x-www-form-urlencoded") {
|
|
134
135
|
var searchParams = new url_1.URLSearchParams();
|
|
135
|
-
for (var _i = 0,
|
|
136
|
-
var key =
|
|
136
|
+
for (var _i = 0, _b = Object.keys(this.computedConfig.body); _i < _b.length; _i++) {
|
|
137
|
+
var key = _b[_i];
|
|
137
138
|
var value = this.computedConfig.body[key];
|
|
138
139
|
searchParams.append(key, value === null || value === void 0 ? void 0 : value.toString());
|
|
139
140
|
}
|
package/esm/RequestContext.js
CHANGED
|
@@ -125,13 +125,14 @@ var RequestContext = /** @class */ (function () {
|
|
|
125
125
|
return this;
|
|
126
126
|
};
|
|
127
127
|
RequestContext.prototype.parseRequestBody = function () {
|
|
128
|
+
var _a;
|
|
128
129
|
if (this.computedConfig.body && this.computedConfig.headers) {
|
|
129
130
|
var contentTypeKey = Object.keys(this.computedConfig.headers).find(function (key) { return key.toLowerCase() === "content-type"; });
|
|
130
|
-
var contentType = contentTypeKey && this.computedConfig.headers[contentTypeKey];
|
|
131
|
-
if (
|
|
131
|
+
var contentType = contentTypeKey && ((_a = this.computedConfig.headers[contentTypeKey]) === null || _a === void 0 ? void 0 : _a.toString());
|
|
132
|
+
if (contentType === "application/x-www-form-urlencoded") {
|
|
132
133
|
var searchParams = new URLSearchParams();
|
|
133
|
-
for (var _i = 0,
|
|
134
|
-
var key =
|
|
134
|
+
for (var _i = 0, _b = Object.keys(this.computedConfig.body); _i < _b.length; _i++) {
|
|
135
|
+
var key = _b[_i];
|
|
135
136
|
var value = this.computedConfig.body[key];
|
|
136
137
|
searchParams.append(key, value === null || value === void 0 ? void 0 : value.toString());
|
|
137
138
|
}
|