proper encoding of query params
This commit is contained in:
9
dist/lib/swagger.js
vendored
9
dist/lib/swagger.js
vendored
@@ -389,20 +389,17 @@
|
|||||||
if (includeApiKey == null) {
|
if (includeApiKey == null) {
|
||||||
includeApiKey = true;
|
includeApiKey = true;
|
||||||
}
|
}
|
||||||
return this.getMatchingParams(['header'], args, includeApiKey, false);
|
return this.getMatchingParams(['header'], args, includeApiKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args, includeApiKey, urlEncode) {
|
SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args, includeApiKey) {
|
||||||
var matchingParams, param, _i, _len, _ref;
|
var matchingParams, param, _i, _len, _ref;
|
||||||
if (urlEncode == null) {
|
|
||||||
urlEncode = true;
|
|
||||||
}
|
|
||||||
matchingParams = {};
|
matchingParams = {};
|
||||||
_ref = this.parameters;
|
_ref = this.parameters;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
param = _ref[_i];
|
param = _ref[_i];
|
||||||
if ((jQuery.inArray(param.paramType, paramTypes) >= 0) && args[param.name]) {
|
if ((jQuery.inArray(param.paramType, paramTypes) >= 0) && args[param.name]) {
|
||||||
matchingParams[param.name] = urlEncode ? encodeURIComponent(args[param.name]) : args[param.name];
|
matchingParams[param.name] = args[param.name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (includeApiKey && (this.resource.api.api_key != null) && this.resource.api.api_key.length > 0) {
|
if (includeApiKey && (this.resource.api.api_key != null) && this.resource.api.api_key.length > 0) {
|
||||||
|
|||||||
@@ -389,20 +389,17 @@
|
|||||||
if (includeApiKey == null) {
|
if (includeApiKey == null) {
|
||||||
includeApiKey = true;
|
includeApiKey = true;
|
||||||
}
|
}
|
||||||
return this.getMatchingParams(['header'], args, includeApiKey, false);
|
return this.getMatchingParams(['header'], args, includeApiKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args, includeApiKey, urlEncode) {
|
SwaggerOperation.prototype.getMatchingParams = function(paramTypes, args, includeApiKey) {
|
||||||
var matchingParams, param, _i, _len, _ref;
|
var matchingParams, param, _i, _len, _ref;
|
||||||
if (urlEncode == null) {
|
|
||||||
urlEncode = true;
|
|
||||||
}
|
|
||||||
matchingParams = {};
|
matchingParams = {};
|
||||||
_ref = this.parameters;
|
_ref = this.parameters;
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
param = _ref[_i];
|
param = _ref[_i];
|
||||||
if ((jQuery.inArray(param.paramType, paramTypes) >= 0) && args[param.name]) {
|
if ((jQuery.inArray(param.paramType, paramTypes) >= 0) && args[param.name]) {
|
||||||
matchingParams[param.name] = urlEncode ? encodeURIComponent(args[param.name]) : args[param.name];
|
matchingParams[param.name] = args[param.name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (includeApiKey && (this.resource.api.api_key != null) && this.resource.api.api_key.length > 0) {
|
if (includeApiKey && (this.resource.api.api_key != null) && this.resource.api.api_key.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user