How to send special headers on handshake?

10 views
Skip to first unread message

André Oliveira

unread,
Apr 2, 2019, 8:39:46 AM4/2/19
to cometd-dev
Hi!

In our application with cometd 4.0.3 javascript library we are facing some problems. In the config of cometd we're adding the Basic Authorization header to the requestHeaders property. Because of that, all the requests sent to the server are trying to authenticate the user on the LDAP server. We want to send the authorization header only for the handshake (without setting the requestHeaders property), is this possible?

Thanks in advance,

Simone Bordet

unread,
Apr 2, 2019, 9:53:05 AM4/2/19
to cometd-dev
Hi,

On Tue, Apr 2, 2019 at 2:39 PM André Oliveira <braa...@gmail.com> wrote:
>
> Hi!
>
> In our application with cometd 4.0.3 javascript library we are facing some problems. In the config of cometd we're adding the Basic Authorization header to the requestHeaders property. Because of that, all the requests sent to the server are trying to authenticate the user on the LDAP server. We want to send the authorization header only for the handshake (without setting the requestHeaders property), is this possible?
>

Yes, `requestHeaders` is an object and therefore mutable.
You can assign the additional headers before the handshake, and clear
`requestHeaders` after the handshake, in a handshake callback.

I'll take care of updating the documentation.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Reply all
Reply to author
Forward
0 new messages