Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web_console/permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/web_console/permissions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading