camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Unsafe Headers present in HTTP Component
Date Fri, 22 May 2009 16:22:17 GMT
On Fri, May 22, 2009 at 1:21 AM, harinair <> wrote:
> Hi All:
> I use Camel to post messages to an external vendor's HTTP server using the
> HTTP Producer. Recently some we found that our messages are not being
> accepted by Microsoft IIS server. When we looked closely we found that a
> bunch of headers probably generated by Sun MQ is there in the message. These
> headers had names like Java method names like getName() - yes even with the
> parenthesis. IIS considers the headers with parenthesis as unsafe and
> rejects the whole message with a 400 Bad request.
> So I modified the process just before the recepientList (see the route at
> the end of my message: bean name securityHeaderGenerator) to remove the
> headers with parenthesis in the name. To my astonishment I found that those
> unsafe headers that finally ended up in the stream were not present in the
> Message! So where did the following headers come from? Is it part of a
> object serialization?
> getname() : DeliveryChannel0Q
> getversion() : 3.0
> isreadonly() : false
> getproperties() : {imqDestinationName=DeliveryChannel0Q,
> imqDestinationDescription=A Description for the Destination Object}

Is the endpoint "routerDeliveryChannelAQueue" a Sun MQ queue?

When Camel consumes a message from JMS and you route it somewhere, the
headers will often also be sent along the payload, if the transport in
question supports that. For instance HTTP does. And since the original
message is JMS based I guess the javax.jms.Message object can return
SUN specific headers when asked for all the headers.

Many of the components in Camel have a HeaderFilterStrategy where you
can define which headers you want to pass or not. So you could
configure the http component to use your version of a
HeaderFilterStrategy to only pass a certain few http headers you like.

But the processor job you do will of course also do the trick and
remove the unwanted ones from SUN MQ.

>        <route errorHandlerRef="dataPushErrorHandler">
>            <from ref="routerDeliveryChannelAQueue" />
>            <process ref="securityHeaderGenerator" />
>            <to ref="routerLogDefault" />
>            <recipientList>
>                <xpath resultType="java.lang.String">$routerRoute</xpath>
>            </recipientList>
>            <to uri="bean:responseVerificationProcessor?method=process" />
>        </route>
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Apache Camel Committer

Open Source Integration:

View raw message