Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/org/adblockplus/brazil/RequestHandler.java

Issue 8851049: ABP/Android Domain specific filters (Closed)
Patch Set: Created Nov. 15, 2012, 7:38 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« res/values/bools.xml ('K') | « res/values/bools.xml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« res/values/bools.xml ('K') | « res/values/bools.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld