[ejabberd] BOSH / IE7 hanging

Hisham Mardam Bey hisham.mardambey at gmail.com
Wed Aug 8 05:41:14 MSK 2012

On Tue, Aug 7, 2012 at 1:23 AM, Hisham Mardam Bey
<hisham.mardambey at gmail.com> wrote:
>> The section above suggests that something can affect the outcome of
>> the headers, whether they're HTML_DOCTYPE or XHTML_DOCTYPE, and that
>> thing is the "html" atom that we're checking for in Headers. The
>> question I have is what gets that "html" into Headers? I
> A bit more clarification here.
> The next bit of code goes on like this:
>     Headers1 = case lists:keysearch("Content-Type", 1, Headers) of
>        {value, _} ->
>            [{"Content-Length", integer_to_list(size(Data))} |
>       Headers];
>        _ ->
>            [{"Content-Type", "text/html; charset=utf-8"},
>       {"Content-Length", integer_to_list(size(Data))} |
>       Headers]
>          end,
> So if there's no Content-Type the code tries to use "text/html". The
> main issue is that there's always a value coming form
> src/web/http_bind.hrl:
> -define(CT_XML, {"Content-Type", "text/xml; charset=utf-8"}).
> ...
> Of course if I recompile Ejabberd with slight modifications to those
> headers IE7 works.
> Are there other options?

Quick update for those watching this thread - a quick fix to get
things tested on IE7 until a proper fix is in place was to rewrite our
response headers. Since IE7 won't be doing CORS anyway we're passing
it through HAProxy on the same domain that then load balances across
the Ejabberd servers. We quickly (shamefully? hehe) rewrite the
headers like so:

rspirep ^Content-Type:.* Content-Type:\ text/html;\ charset=utf-8

to get things working.

I'll get back into the Ejabberd code tomorrow or later this week. At
this point I'm wondering if the headers will always be what's
-define'ed in http_bind.hrl  and as such whether we need to patch
Ejabberd to respect an "Accept" header. Does this make sense or am I
missing this code in Ejabberd?

Thanks! (=


Hisham Mardam-Bey

More information about the ejabberd mailing list