From bf2eb3b251784d0dd21be5d3fa7fa5c363e64f66 Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Sat, 13 Jan 2018 17:36:40 -0500 Subject: [PATCH] Add hasOwnProperty checks to AuthSvc --- app/public/services/AuthSvc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/public/services/AuthSvc.js b/app/public/services/AuthSvc.js index e387e93..03c38f7 100755 --- a/app/public/services/AuthSvc.js +++ b/app/public/services/AuthSvc.js @@ -9,7 +9,8 @@ angular.module('AuthSvc', []).service('AuthService', ['$http', '$window', functi 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: user @@ -36,7 +37,8 @@ angular.module('AuthSvc', []).service('AuthService', ['$http', '$window', functi 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: user