diff --git a/lib/web_console/permissions.rb b/lib/web_console/permissions.rb index 19f9535c..22e61979 100644 --- a/lib/web_console/permissions.rb +++ b/lib/web_console/permissions.rb @@ -5,7 +5,7 @@ module WebConsole class Permissions # IPv4 and IPv6 localhost should be always allowed. - ALWAYS_PERMITTED_NETWORKS = %w( 127.0.0.0/8 ::1 ) + ALWAYS_PERMITTED_NETWORKS = %w( 127.0.0.0/8 ::1 ::ffff:127.0.0.0/104 ) def initialize(networks = nil) @networks = normalize_networks(networks).map(&method(:coerce_network_to_ipaddr)).uniq diff --git a/test/web_console/permissions_test.rb b/test/web_console/permissions_test.rb index 91797931..2bed2b80 100644 --- a/test/web_console/permissions_test.rb +++ b/test/web_console/permissions_test.rb @@ -9,6 +9,7 @@ class PermissionsTest < ActiveSupport::TestCase assert_includes permissions, "127.0.0.1" assert_includes permissions, "::1" + assert_includes permissions, "::ffff:127.0.0.1" end test "permits single IPs" do @@ -41,7 +42,7 @@ class PermissionsTest < ActiveSupport::TestCase end test "human readable presentation" do - assert_includes permit.to_s, "127.0.0.0/127.255.255.255, ::1" + assert_includes permit.to_s, "127.0.0.0/127.255.255.255, ::1, ::ffff:127.0.0.0/::ffff:127.255.255.255" end private