| OLD | NEW |
| 1 package org.adblockplus.brazil; | 1 package org.adblockplus.brazil; |
| 2 | 2 |
| 3 import java.io.EOFException; | 3 import java.io.EOFException; |
| 4 import java.io.FilterInputStream; | 4 import java.io.FilterInputStream; |
| 5 import java.io.FilterOutputStream; | 5 import java.io.FilterOutputStream; |
| 6 import java.io.IOException; | 6 import java.io.IOException; |
| 7 import java.io.InterruptedIOException; | 7 import java.io.InterruptedIOException; |
| 8 import java.io.OutputStream; | 8 import java.io.OutputStream; |
| 9 import java.net.ConnectException; | 9 import java.net.ConnectException; |
| 10 import java.net.MalformedURLException; | 10 import java.net.MalformedURLException; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (referrer != null) | 96 if (referrer != null) |
| 97 refHost = (new URL(referrer)).getHost(); | 97 refHost = (new URL(referrer)).getHost(); |
| 98 } | 98 } |
| 99 catch (MalformedURLException e) | 99 catch (MalformedURLException e) |
| 100 { | 100 { |
| 101 // We are transparent, it's not our deal if it's malformed. | 101 // We are transparent, it's not our deal if it's malformed. |
| 102 } | 102 } |
| 103 | 103 |
| 104 try | 104 try |
| 105 { | 105 { |
| 106 if (referrer != null) | 106 block = application.matches(request.url, request.query, reqHost, refHost,
request.getRequestHeader("accept")); |
| 107 block = application.matches(request.url, request.query, reqHost, refHost
, request.getRequestHeader("accept")); | |
| 108 } | 107 } |
| 109 catch (Exception e) | 108 catch (Exception e) |
| 110 { | 109 { |
| 111 Log.e(prefix, "Filter error", e); | 110 Log.e(prefix, "Filter error", e); |
| 112 } | 111 } |
| 113 | 112 |
| 114 request.log(Server.LOG_LOG, prefix, block + ": " + request.url + " ("+ refHo
st +")"); | 113 request.log(Server.LOG_LOG, prefix, block + ": " + request.url + " ("+ refHo
st +")"); |
| 115 | 114 |
| 116 int count = request.server.requestCount; | 115 int count = request.server.requestCount; |
| 117 if (shouldLogHeaders) | 116 if (shouldLogHeaders) |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 } | 377 } |
| 379 | 378 |
| 380 for (int i = 0; i < headers.size(); i++) | 379 for (int i = 0; i < headers.size(); i++) |
| 381 { | 380 { |
| 382 sb.append(prompt).append(headers.getKey(i)); | 381 sb.append(prompt).append(headers.getKey(i)); |
| 383 sb.append(": ").append(headers.get(i)).append("\n"); | 382 sb.append(": ").append(headers.get(i)).append("\n"); |
| 384 } | 383 } |
| 385 return (sb.toString()); | 384 return (sb.toString()); |
| 386 } | 385 } |
| 387 } | 386 } |
| OLD | NEW |