Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 sb.append((char) character); | 125 sb.append((char) character); |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 response.setStatus(NsStatus.OK); | 129 response.setStatus(NsStatus.OK); |
130 response.setResponse(sb.toString()); | 130 response.setResponse(sb.toString()); |
131 | 131 |
132 if (connection.getHeaderFields().size() > 0) | 132 if (connection.getHeaderFields().size() > 0) |
133 { | 133 { |
134 List<HeaderEntry> responseHeaders = new LinkedList<HeaderEntry>(); | 134 List<HeaderEntry> responseHeaders = new LinkedList<HeaderEntry>(); |
135 for (Map.Entry<String, List<String>> eachEntry : connection.getHeade rFields().entrySet()) | 135 for (Map.Entry<String, List<String>> eachEntry : connection.getHeaderF ields().entrySet()) |
anton
2016/07/19 09:50:30
decided to fit it into 1 line (though it's 101 cha
diegocarloslima
2016/09/06 23:02:14
This 'for' block still have wrong indentation. It
anton
2016/09/08 13:27:44
Acknowledged.
| |
136 { | |
137 for (String eachValue : eachEntry.getValue()) | |
136 { | 138 { |
137 for (String eachValue : eachEntry.getValue()) | 139 if (eachEntry.getKey() != null && eachValue != null) |
138 { | 140 { |
139 if (eachEntry.getKey() != null && eachValue != null) | 141 responseHeaders.add(new HeaderEntry(eachEntry.getKey(), eachValu e)); |
140 { | |
141 responseHeaders.add(new HeaderEntry(eachEntry.getKey(), eachVa lue)); | |
142 } | |
143 } | 142 } |
144 } | 143 } |
144 } | |
145 response.setReponseHeaders(responseHeaders); | 145 response.setReponseHeaders(responseHeaders); |
146 } | 146 } |
147 | 147 |
148 connection.disconnect(); | 148 connection.disconnect(); |
149 } | 149 } |
150 else | 150 else |
151 { | 151 { |
152 response.setStatus(NsStatus.ERROR_FAILURE); | 152 response.setStatus(NsStatus.ERROR_FAILURE); |
153 } | 153 } |
154 return response; | 154 return response; |
155 } | 155 } |
156 catch (final Throwable t) | 156 catch (final Throwable t) |
157 { | 157 { |
158 throw new AdblockPlusException("WebRequest failed", t); | 158 throw new AdblockPlusException("WebRequest failed", t); |
159 } | 159 } |
160 } | 160 } |
161 } | 161 } |
LEFT | RIGHT |