Skip to content
Browse files

do 169.254 too

  • Loading branch information...
1 parent 8f69a63 commit 108045f5bc23d8ed5f2e1520f2d3a6570b3dcf4a @atmos committed Dec 14, 2010
Showing with 7 additions and 1 deletion.
  1. +1 −1 server.coffee
  2. +6 −0 test/proxy_test.rb
View
2 server.coffee
@@ -15,7 +15,7 @@ log = (msg) ->
console.log(msg)
console.log("--------------------------------------------")
-RESTRICTED_IPS = /^(10\.)|(127\.)|(192\.168)|(172\.(1[6-9])|(2[0-9])|(3[0-1]))/
+RESTRICTED_IPS = /^(10\.)|(127\.)|(169\.254)|(192\.168)|(172\.(1[6-9])|(2[0-9])|(3[0-1]))/
server = Http.createServer (req, resp) ->
if req.method != 'GET' || req.url == '/'
View
6 test/proxy_test.rb
@@ -77,6 +77,12 @@ def test_404s_on_10_0_ip_range
end
end
+ def test_404s_on_169_254_ip_range
+ assert_raise RestClient::ResourceNotFound do
+ request('http://169.254.0.1/foo.cgi')
+ end
+ end
+
def test_404s_on_192_168_ip_range
assert_raise RestClient::ResourceNotFound do
request('http://192.168.0.1/foo.cgi')

0 comments on commit 108045f

Please sign in to comment.
Something went wrong with that request. Please try again.