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

Delta Between Two Patch Sets: src/org/adblockplus/brazil/TransparentProxyHandler.java

Issue 5697499218051072: Usage of new API, cleanups (reduced) (Closed)
Left Patch Set: Fixed leftover first-batch review issues. Created April 16, 2014, 5:51 p.m.
Right Patch Set: Even more review issues fixed. Created April 28, 2014, 10:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/org/adblockplus/brazil/SSLConnectionHandler.java ('k') | src/org/adblockplus/libadblockplus/Filter.java » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 11 matching lines...) Expand all
22 import sunlabs.brazil.server.Handler; 22 import sunlabs.brazil.server.Handler;
23 import sunlabs.brazil.server.Request; 23 import sunlabs.brazil.server.Request;
24 import sunlabs.brazil.server.Server; 24 import sunlabs.brazil.server.Server;
25 25
26 /** 26 /**
27 * Reconstructs request url to comply with proxy specification if transparent 27 * Reconstructs request url to comply with proxy specification if transparent
28 * proxy is used. 28 * proxy is used.
29 */ 29 */
30 public class TransparentProxyHandler implements Handler 30 public class TransparentProxyHandler implements Handler
31 { 31 {
32
32 @Override 33 @Override
33 public boolean init(final Server server, final String prefix) 34 public boolean init(final Server server, final String prefix)
34 { 35 {
35 return true; 36 return true;
36 } 37 }
37 38
38 @Override 39 @Override
39 public boolean respond(final Request request) throws IOException 40 public boolean respond(final Request request) throws IOException
40 { 41 {
41 if (!request.url.contains("://")) 42 if (!request.url.contains("://"))
42 { 43 {
43 request.url = "http://" + request.headers.get("host") + request.url; 44 request.url = "http://" + request.headers.get("host") + request.url;
44 } 45 }
45 return false; 46 return false;
46 } 47 }
48
47 } 49 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld