Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2882

Add support for setting the HTTP invoker content encoding that is accepted

XMLWordPrintable

      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"

              starksm64 Scott Stark (Inactive)
              starksm64 Scott Stark (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: