Skip to content

Commit

Permalink
upgrade away from security warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
refractalize committed Oct 21, 2019
1 parent bb2e51a commit 40289ab
Show file tree
Hide file tree
Showing 6 changed files with 1,044 additions and 1,321 deletions.
8 changes: 4 additions & 4 deletions client.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function responseCompatibility (response) {
}

if (response.body instanceof Object && !Object.isFrozen(response.body)) {
if (!response.body.hasOwnProperty('body')) {
if (!Object.prototype.hasOwnProperty.call(response.body, 'body')) {
Object.defineProperty(response.body, 'body', {
get: function () {
responseWarning()
Expand All @@ -73,7 +73,7 @@ function responseCompatibility (response) {
})
}

if (!response.body.hasOwnProperty('url')) {
if (!Object.prototype.hasOwnProperty.call(response.body, 'url')) {
Object.defineProperty(response.body, 'url', {
get: function () {
responseWarning()
Expand All @@ -82,7 +82,7 @@ function responseCompatibility (response) {
})
}

if (!response.body.hasOwnProperty('statusCode')) {
if (!Object.prototype.hasOwnProperty.call(response.body, 'statusCode')) {
Object.defineProperty(response.body, 'statusCode', {
get: function () {
responseWarning()
Expand All @@ -91,7 +91,7 @@ function responseCompatibility (response) {
})
}

if (!response.body.hasOwnProperty('headers')) {
if (!Object.prototype.hasOwnProperty.call(response.body, 'headers')) {
Object.defineProperty(response.body, 'headers', {
get: function () {
responseWarning()
Expand Down
2 changes: 1 addition & 1 deletion deepExtend.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function deepExtend (x, y) {
var yValue = y[key]
var xValue = x[key]

if (x.hasOwnProperty(key) && isObject(xValue) && isObject(yValue)) {
if (Object.prototype.hasOwnProperty.call(x, key) && isObject(xValue) && isObject(yValue)) {
var r = {}
deepExtend(r, xValue)
deepExtend(r, yValue)
Expand Down
4 changes: 2 additions & 2 deletions middleware/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function urlProtocol (url) {
}

function createStore (options) {
var url = typeof options === 'object' && options.hasOwnProperty('url') ? options.url : undefined
var url = typeof options === 'object' && Object.prototype.hasOwnProperty.call(options, 'url') ? options.url : undefined
var protocol = urlProtocol(url)

var storeConstructor = storeTypes[protocol]
Expand All @@ -28,7 +28,7 @@ function createStore (options) {
module.exports = function (options) {
var store = createStore(options)
var isResponseCachable = typeof options === 'object' &&
options.hasOwnProperty('isResponseCachable')
Object.prototype.hasOwnProperty.call(options, 'isResponseCachable')
? options.isResponseCachable
: function (response) {
return response.statusCode >= 200 && response.statusCode < 400
Expand Down
2 changes: 1 addition & 1 deletion middleware/fileStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function writeStreamToFile (filename, stream) {
}

module.exports = function (options) {
var path = typeof options === 'object' && options.hasOwnProperty('url') ? options.url : undefined
var path = typeof options === 'object' && Object.prototype.hasOwnProperty.call(options, 'url') ? options.url : undefined

return {
filename: function (url) {
Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"dependencies": {
"base-64": "0.1.0",
"debug": "4.1.1",
"end-of-stream": "1.4.1",
"end-of-stream": "1.4.4",
"fs-promise": "2.0.3",
"global": "4.3.2",
"https-proxy-agent": "2.2.1",
"global": "4.4.0",
"https-proxy-agent": "3.0.0",
"mime-types": "2.1.24",
"proxy-from-env": "1.0.0",
"random-string": "0.2.0",
Expand All @@ -20,41 +20,41 @@
"basic-auth": "2.0.1",
"basic-auth-connect": "1.0.0",
"body-parser": "1.19.0",
"browserify": "16.2.3",
"browserify": "16.5.0",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"cookie-parser": "1.4.4",
"cors": "2.8.5",
"electron": "5.0.0",
"es6-promise": "4.2.6",
"eslint": "5.16.0",
"eslint-config-standard": "12.0.0",
"eslint-plugin-es5": "1.3.1",
"eslint-plugin-import": "2.17.2",
"eslint-plugin-node": "8.0.1",
"eslint-plugin-promise": "4.1.1",
"eslint-plugin-standard": "4.0.0",
"express": "4.16.4",
"fake-xml-http-request": "2.0.0",
"form-data": "2.3.3",
"http-proxy": "1.17.0",
"karma": "4.1.0",
"karma-browserify": "6.0.0",
"electron": "6.0.12",
"es6-promise": "4.2.8",
"eslint": "6.5.1",
"eslint-config-standard": "14.1.0",
"eslint-plugin-es5": "1.4.1",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-node": "10.0.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.1",
"express": "4.17.1",
"fake-xml-http-request": "2.0.1",
"form-data": "2.5.1",
"http-proxy": "1.18.0",
"karma": "4.4.1",
"karma-browserify": "6.1.0",
"karma-browserstack-launcher": "1.5.1",
"karma-chrome-launcher": "2.2.0",
"karma-chrome-launcher": "3.1.0",
"karma-electron-launcher": "^0.2.0",
"karma-mocha": "1.3.0",
"karma-mocha-reporter": "2.2.5",
"karma-server-side": "1.8.0",
"mocha": "6.1.4",
"mocha": "6.2.2",
"multiparty": "4.2.1",
"qs": "6.7.0",
"qs": "6.9.0",
"server-destroy": "1.0.1",
"standard": "12.0.1",
"uglify-js": "3.5.10",
"standard": "14.3.1",
"uglify-js": "3.6.3",
"url-template": "2.0.8",
"watchify": "3.11.1",
"webpack": "4.30.0"
"webpack": "4.41.2"
},
"directories": {
"test": "test"
Expand Down
Loading

0 comments on commit 40289ab

Please sign in to comment.