From 77493426f63eb18a5ee4882bcec5ab3845080ba2 Mon Sep 17 00:00:00 2001 From: Ayush Gupta Date: Tue, 17 Jul 2012 00:10:28 -0700 Subject: [PATCH] proper encoding of query params --- dist/lib/swagger.js | 9 +++------ lib/swagger.js | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dist/lib/swagger.js b/dist/lib/swagger.js index 6152e24b..6ea1c201 100644 --- a/dist/lib/swagger.js +++ b/dist/lib/swagger.js @@ -389,20 +389,17 @@ if (includeApiKey == null) { 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; - if (urlEncode == null) { - urlEncode = true; - } matchingParams = {}; _ref = this.parameters; for (_i = 0, _len = _ref.length; _i < _len; _i++) { param = _ref[_i]; 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) { diff --git a/lib/swagger.js b/lib/swagger.js index 6152e24b..6ea1c201 100644 --- a/lib/swagger.js +++ b/lib/swagger.js @@ -389,20 +389,17 @@ if (includeApiKey == null) { 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; - if (urlEncode == null) { - urlEncode = true; - } matchingParams = {}; _ref = this.parameters; for (_i = 0, _len = _ref.length; _i < _len; _i++) { param = _ref[_i]; 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) {