6 Replies Latest reply on Apr 29, 2016 9:27 AM by Guttorm Vik

    Strange case of CRLF being inserted into a gz file

    Guttorm Vik Newbie

      We have a huge js file on the server that we have pre-packed into a gz file.

      ( It is a javascript generated by GWT, via Vaadin, if anyone is interested.)

       

      Some users will occasionally get a corrupt file.

      When I examine the gz file in their cache, I can see that a pair of CR LF has been inserted into the file, and two bytes have been shaved off the end, so that the size is unchanged.

       

      What is annoying is that both Chrome and IE will accept the file. When it is unzipped the resulting js file is full of interesting syntax errors.

       

      When this first occurred we discovered that we had forgotten to switch the GWT compiler from "PRETTY", so the file was embarrasingly large.

      The inserted CR LF then always appeared at offset 0x5ff6.

      It was not enough to do a ctrl-F5 to get around the problem. The user had to clear their cache.

       

      Now we have compiled the file with the "Obfuscated" option, so it is much smaller.

      For the one instance we have had so far, the offset was now 0x414B

      But.. ctrl-F5 now gets around the problem..

       

      This happens on two different servers, both running Wildfly 8.2.0.Final.

      These are hosted for us, so there *might* be some misbehaving proxy between the servers and the users.

      Or perhaps there is a bug in undertow?

       

      Anyone experienced something like this?