diff options
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/service/StreamProxy.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/StreamProxy.java b/src/github/daneren2005/dsub/service/StreamProxy.java index 76d8382c..0b269de6 100644 --- a/src/github/daneren2005/dsub/service/StreamProxy.java +++ b/src/github/daneren2005/dsub/service/StreamProxy.java @@ -103,9 +103,10 @@ public class StreamProxy implements Runnable { HttpRequest request = null;
InputStream is;
String firstLine;
+ BufferedReader reader = null;
try {
is = client.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(is), 8192);
+ reader = new BufferedReader(new InputStreamReader(is), 8192);
firstLine = reader.readLine();
} catch (IOException e) {
Log.e(TAG, "Error parsing request", e);
@@ -123,6 +124,19 @@ public class StreamProxy implements Runnable { String realUri = uri.substring(1);
Log.i(TAG, realUri);
request = new BasicHttpRequest(method, realUri);
+
+ // Get all of the headers
+ try {
+ String line;
+ while(line = reader.readLine() && !"".equals(line)) {
+ String headerName = line.substring(0, line.indexOf(':'));
+ String headerValue = line.substring(line.indexOf(': ') + 2);
+ request.addHeader(headerName, headerValue);
+ }
+ } catch(IOException e) {
+ // Don't really care once past first line
+ }
+
return request;
}
|