From 9e36c3c24417af1dab40a48f6075fd6e8a92b953 Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Sun, 14 Jan 2018 09:50:54 -0500 Subject: [PATCH] Add hasOwnProperty checks to ApiSvc --- app/public/services/ApiSvc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/public/services/ApiSvc.js b/app/public/services/ApiSvc.js index 58e9357..fdf658e 100755 --- a/app/public/services/ApiSvc.js +++ b/app/public/services/ApiSvc.js @@ -28,7 +28,8 @@ angular.module('ApiSvc', []).service('ApiService', ['$http', function ($http) { transformRequest: function (obj) { var str = []; for (var p in obj) - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); + if (obj.hasOwnProperty(p)) + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); return str.join("&"); }, data: {key: key.key} @@ -45,7 +46,8 @@ angular.module('ApiSvc', []).service('ApiService', ['$http', function ($http) { transformRequest: function (obj) { var str = []; for (var p in obj) - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); + if (obj.hasOwnProperty(p)) + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); return str.join("&"); }, data: key