Project

General

Profile

CORS issue when call "disconnect" method from Strophe.js

Igor Khomenko
Added over 4 years ago

Hi there,

we are facing an issue with Strophe.js library

everything works great, but when we call a disconnect method -

https://github.com/strophe/strophejs/blob/master/src/core.js#L2168

it causes a CORS error:

XMLHttpRequest cannot load https://chat.domain.com:8081/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 502. 

We use Tigase 5.2.0

Is there anything we should setup?


Replies (3)

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Have you made any changes to Tigase installation? Do client access it directly (or does the issue manifest itself when they do)? Mentioned header is present in default bosh-extra-headers.txt file shipped with Tigase.

Added by Igor Khomenko over 4 years ago

No changes were made

There is a file like this

Actually it works without any issues: login, send message/presence etc features work

Just one case where we call Strophe.js disconnect method - it causes this issue

Added by Wojciech Kapcia TigaseTeam over 4 years ago

Can you verify that this header in response is present in all other cases and in fact missing while disconnecting? Can you check tigase logs (you would need to enable debug for at least @--debug=server.bosh@) for presence/absence of this header in responses?

    (1-3/3)