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

Unified Diff: libadblockplus-android/src/org/adblockplus/android/AndroidWebRequest.java

Issue 29346561: Issue 4160 - Return headers in AndroidWebRequest (Closed)
Patch Set: Codestyle fixes Created July 13, 2016, 6:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/src/org/adblockplus/android/AndroidWebRequest.java
diff --git a/libadblockplus-android/src/org/adblockplus/android/AndroidWebRequest.java b/libadblockplus-android/src/org/adblockplus/android/AndroidWebRequest.java
index 77ce37145b7a54d0649a476056fc954ecfc38158..bdf1408bd8bea5cfc45dd4510f653148435de0f5 100644
--- a/libadblockplus-android/src/org/adblockplus/android/AndroidWebRequest.java
+++ b/libadblockplus-android/src/org/adblockplus/android/AndroidWebRequest.java
@@ -129,14 +129,18 @@ public class AndroidWebRequest extends WebRequest
response.setStatus(NsStatus.OK);
response.setResponse(sb.toString());
- // headers
- if (connection.getHeaderFields().size() > 0) {
+ if (connection.getHeaderFields().size() > 0)
+ {
List<HeaderEntry> responseHeaders = new LinkedList<HeaderEntry>();
for (Map.Entry<String, List<String>> eachEntry :
connection.getHeaderFields().entrySet())
+ {
for (String eachValue : eachEntry.getValue())
+ {
if (eachEntry.getKey() != null && eachValue != null)
responseHeaders.add(new HeaderEntry(eachEntry.getKey(), eachValue));
+ }
+ }
response.setReponseHeaders(responseHeaders);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld