diff --git a/is-development.js b/is-development.js index b8644f52..f198d538 100644 --- a/is-development.js +++ b/is-development.js @@ -1,7 +1,7 @@ module.exports = function isDevelopment (url) { return ( /^wss?:\/\/localhost/.test(url) || - /^wss?:\/\/127\.0\.0\.1/.test(url) || + /^wss?:\/\/127(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/.test(url) || /^wss?:\/\/ip6-localhost/.test(url) || /^wss?:\/\/::1/.test(url) || /^wss?:\/\/[^/\s:]+\.dev(\/|:|$)/.test(url) || diff --git a/test/is-development.test.js b/test/is-development.test.js index 4038d710..25c6a0e8 100644 --- a/test/is-development.test.js +++ b/test/is-development.test.js @@ -10,6 +10,7 @@ function detects (base) { it('detects localhost', function () { detects('localhost') detects('127.0.0.1') + detects('127.255.127.1') }) it('detects IP6 localhost', function () {