<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,6 +12,7 @@ class AssetsController &lt; ApplicationController
   
   @@valid_listeners = ['msie','webkit','gecko','mozilla','netscape','itunes','chrome','opera', 'safari']
   @@bots = ['bot','spider','baidu']
+  @@bad_ip_ranges = ['195.239', '220.181', '61.135', '60.28.232', '121.14', '221.194']
   
   # GET /assets
   # GET /assets.xml
@@ -278,8 +279,10 @@ class AssetsController &lt; ApplicationController
   end
   
   def bot?
+    ip = request.remote_ip
     return true unless present? request.user_agent 
-    not browser? or @@bots.any?{|bot_agent| @agent.include? bot_agent}
+    return true if @@bad_ip_ranges.any?{|cloaked_ip| ip.match /^#{cloaked_ip}/  } # check bad ips that fake user agent
+    not browser? or @@bots.any?{|bot_agent| @agent.include? bot_agent} # check user agent
   end
   
   def browser?</diff>
      <filename>app/controllers/assets_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ describe AssetsController do
     &quot;Mp3Bot/0.1 (http://mp3realm.org/mp3bot/)&quot;,
     &quot;&quot;,
     &quot;Googlebot/2.1 (+http://www.google.com/bot.html)&quot;,
-    &quot;you're momma's so bot...&quot;
+    &quot;you're momma's so bot...&quot;,
     &quot;Baiduspider+(+http://www.baidu.jp/spider/)&quot;,
     &quot;baidu/Nutch-1.0 &quot;
   ]</diff>
      <filename>spec/controllers/assets_controller_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2aafad68412ece657b5da6c85ade83232d747eb5</id>
    </parent>
  </parents>
  <author>
    <name>Sudara</name>
    <email>sudara@alonetone.com</email>
  </author>
  <url>http://github.com/sudara/alonetone/commit/c2b1757087f5bb2812705cfc0d726d372918a09f</url>
  <id>c2b1757087f5bb2812705cfc0d726d372918a09f</id>
  <committed-date>2009-08-01T14:12:05-07:00</committed-date>
  <authored-date>2009-08-01T14:12:05-07:00</authored-date>
  <message>Deny spiders by ip. finally.</message>
  <tree>16ef582ba6eaec99d3b4982267debb6bc66a7dcd</tree>
  <committer>
    <name>Sudara</name>
    <email>sudara@alonetone.com</email>
  </committer>
</commit>
