Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    CompressionFilter returns no content when Content-Disposition is present

    FYI - we ran into an issue after enabling CompressionFilter. It happens for all browsers (chrome / firefox / IE) with SmartGWT pro 5.0 p20150806.

    A request which used to work now produces the following

    GET /abc/exportToPDF?pk=7& HTTP/1.1
    Accept: */*
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
    Host: 10.141.179.5:9080
    DNT: 1
    Connection: Keep-Alive
    Cookie: smartgwt_version=4.1p; JSESSIONID=02AB04CE1DF3AB1A8FA795148165A7FC; GLog=%7B%0D%20%20%20%20trackRPC%3Afalse%0D%7D; isc_cState=ready; JSESSIONIDSSO=8BDD638E1FC1E4207E2A7B3943447E5E

    HTTP/1.1 204 No Content
    Server: Apache-Coyote/1.1
    Pragma: public
    Cache-Control: must-revalidate
    Expires: Thu, 01 Jan 1970 01:00:00 CET
    X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
    Content-Disposition: filename="abc.pdf"
    Date: Wed, 21 Sep 2016 20:12:58 GMT

    In our code we do

    response.setHeader("Content-Disposition", "filename="abc.pdf"");


    and we think the problem is in
    in class com.isomorphic.servlet.ProxyHttpServletResponse

    it does

    public void rememberHeader(String name, String value) {
    ...
    String lcName = name.toLowerCase();
    ...
    if ((this.unwrapOnContentDisposition) && (name.equals("content-disposition"))) {
    log.info("content-disposition set to: " + value + " - unwrapping response output stream (" + this.creator + ")");

    unwrapOutputStream();
    }

    The HTTP headers are supposed to be case-insensitive by

    https://tools.ietf.org/html/rfc7230 [^]

    3.2. Header Fields

    Each header field consists of a case-insensitive field name followed
    by a colon (":"), optional leading whitespace, the field value, and
    optional trailing whitespace.



    and the code ignores the letter case in some contexts (uses lcName) but compares case-sensitively in other contexts (in this case it doesn't call unwrapOutputStream() as it should)


    We applied a workaround to just type these headers lowercase in our code, but it should probably be fixed in the library (maybe it's already fixed in the newest version, we didn't check)

    best regards,
    Michael Kostrzewa

    #2
    Thanks for the report! We fixed this in nightly builds since Sep 28 (tomorrow).

    Let us know please if there's anything further that's wrong.

    Comment

    Working...
    X