On 02/09/2012 17:09, Philipp Brüll wrote:
> Hi all,
>
> I've implemented an asset server and tried to switch an gzip
> compression. Here is the code
>
> response = request.response
> response.headers["Content-Type"] = "text/javascript; charset=utf-8"
> response.headers["Content-Encoding"] = "gzip"
> response.end compress(code.to_s)
Have a look at the web-server module.
https://github.com/vert-x/mod-web-server/blob/master/src/main/java/org/vertx/mods/WebServer.java
p
> The compress method looks like this
>
> def compress(data)
>
> output = StringIO.new
>
> gz = Zlib::GzipWriter.new output
>
> gz.write data
>
> gz.close
>
> output.string
>
> end
>
>
> The asset is served, but Chrome drops a parser error after loading the
> asset. Any good idea?
>
> Chrome Version 21.0.1180.89
> JRuby 1.6.7.2
> Vert.x 1.2.3
>
> Best regards
>
> --
> You received this message because you are subscribed to the Google
> Groups "vert.x" group.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msg/vertx/-/oYJZ2FNeR08J.
> To post to this group, send an email to
ve...@googlegroups.com.
> To unsubscribe from this group, send email to
>
vertx+un...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/vertx?hl=en-GB.
--
[key:62590808]