-
Feature Request
-
Resolution: Done
-
Major
-
None
-
None
-
Documentation (Ref Guide, User Guide, etc.)
The current http invocation layer does not allow compressed streams because it does not add an Accept-Encoding header with a compression type. Something like this needs to be done to detect how to handle the input stream:
URL url = new URL("http://localhost:8080/invoker/JNDIFactory");
URLConnection conn = url.openConnection();
conn.setRequestProperty("Accept-Encoding", "x-gzip, x-deflate, gzip, deflate");
InputStream is = conn.getInputStream();
Map<String, List<String>> headers = conn.getHeaderFields();
System.out.println(headers);
System.out.println(is);
List<String> encoding = headers.get("Content-Encoding");
boolean gzip = encoding.contains("gzip");
if( gzip )
is = new GZIPInputStream(is);
... other compression stream type detection ...
ObjectInputStream ois = new ObjectInputStream(is);
Object proxy = ois.readObject();
System.out.println(proxy);
is.close();
ois.close();
We should probably default to Accept-Encoding="x-gzip, x-deflate, gzip, deflate, identity"