[undertow-dev] Combining encoding handlers with non-encoding handlers

Girish Sharma scrapmachines at gmail.com
Mon Aug 10 03:49:14 EDT 2015


Thanks Stuart, it works like that. Seems a bit obvious now that I think of
it :)

Regards

On Mon, Aug 10, 2015 at 11:39 AM, Stuart Douglas <sdouglas at redhat.com>
wrote:

> Just add the encoding handler to the appropriate prefix path, instead of
> making it the root handler, e.g.
>
> .addPrefixPath("/pathA", new EncodingHandler ....)
>
> Stuart
>
> ----- Original Message -----
> > From: "Girish Sharma" <scrapmachines at gmail.com>
> > To: undertow-dev at lists.jboss.org
> > Sent: Friday, 7 August, 2015 12:40:10 AM
> > Subject: [undertow-dev] Combining encoding handlers with non-encoding
> handlers
> >
> > Hi team,
> >
> > I am trying to have a situation like this:
> >
> > Path A - response is gzipped,
> > Path B - response is not gzipped.
> >
> > But from extensive searching, I could only figure out a way to make all
> paths
> > as gzipped response.
> >
> > For example:
> >
> > Undertow . builder ().addHttpListener(8080, "localhost").setHandler( new
> > EncodingHandler( new ContentEncodingRepository().addEncodingHandler(
> > "gzip" ,
> > new GzipEncodingProvider(),
> > 50 ,
> > Predicates. parse ( "max-content-size[5]" )
> > )
> > ).setNext(Handlers. path ()
> > .addPrefixPath("/pathA", pathA ::handle)
> > .addPrefixPath("/pathB", pathAB::handle
> > )).build();
> >
> > will make both Path A and Path B as gzip encoded response.
> >
> > Any way to make only 1 of them give gzipped response?
> >
> > Regards
> > --
> > Girish Sharma
> > B.Tech(H), Civil Engineering ,
> > Indian Institute of Technology, Kharagpur
> >
> > _______________________________________________
> > undertow-dev mailing list
> > undertow-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/undertow-dev
>



-- 
Girish Sharma
B.Tech(H), Civil Engineering,
Indian Institute of Technology, Kharagpur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150810/49d23221/attachment.html 


More information about the undertow-dev mailing list