Skip to content
  • Earl J St Sauver's avatar
    9ff18e46
    LOCALHOST definition should match any 127.0.0.0/8 address · 9ff18e46
    Earl J St Sauver authored
    The entire 127.0.0.0/8 range is assigned to the loopback address, not
    only 127.0.0.0/24. This patch allows ActionDispatch::Request::LOCALHOST
    to match any IPv4 127.0.0.0/8 loopback address.
    
    The only place that the #local? method was previously under test was
    in the show_expectations_test.rb file. I don't particularly like that
    that's implicitly where this code is under test, and I feel like I
    should move some of that testing code into the
    test/dispatch/request_test.rb file, but I wanted some feedback first.
    
    Credit goes to @sriedel for discovering the issue and adding the
    patch.
    9ff18e46
    LOCALHOST definition should match any 127.0.0.0/8 address
    Earl J St Sauver authored
    The entire 127.0.0.0/8 range is assigned to the loopback address, not
    only 127.0.0.0/24. This patch allows ActionDispatch::Request::LOCALHOST
    to match any IPv4 127.0.0.0/8 loopback address.
    
    The only place that the #local? method was previously under test was
    in the show_expectations_test.rb file. I don't particularly like that
    that's implicitly where this code is under test, and I feel like I
    should move some of that testing code into the
    test/dispatch/request_test.rb file, but I wanted some feedback first.
    
    Credit goes to @sriedel for discovering the issue and adding the
    patch.
Loading