camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristiano Costantini <>
Subject simple language for filters on values of HTTP headers
Date Tue, 09 Jun 2015 08:01:21 GMT
Hi All,
in a camel route starting with a Jetty endpoint,
I want to enable gzipping if the input sends the http header:
"Accept-Encoding: gzip"

However, the Accept-Encoding may have multiple comma separated values for
different encoding accepted, typical it is

Accept-Encoding: gzip, deflate

As the values are comma separated, I thought about a filter like this to be
fine (xml dsl):

<simple>'gzip' in ${header[Accept-Encoding]}</simple>
... do gizipping ...

the problem is that it works with a header value of "gzip, deflate" but it
won't work for a header value for example of "compress, deflate, exi, gzip,
identity", because the token split by in operator is ' gzip', (note the
extra space in front of it.

Do you have any suggestion to better handle this "dilemma" :-) ?

FYI I'm reverting to use:
<simple>${header[Accept-Encoding]} contains 'gzip'</simple>
... do gizipping ...
but using "in" would seem cleaner to me...


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message