[fix] use currentsite.txt only if host is localhost
This commit is contained in:
parent
269ef51c66
commit
e2649975d2
1 changed files with 6 additions and 4 deletions
10
socketio.js
10
socketio.js
|
|
@ -171,12 +171,14 @@ function get_task_room(socket, task_id) {
|
|||
}
|
||||
|
||||
function get_site_name(socket) {
|
||||
if (conf.default_site) {
|
||||
return conf.default_site;
|
||||
}
|
||||
else if (socket.request.headers['x-frappe-site-name']) {
|
||||
if (socket.request.headers['x-frappe-site-name']) {
|
||||
return get_hostname(socket.request.headers['x-frappe-site-name']);
|
||||
}
|
||||
else if (['localhost', '127.0.0.1'].indexOf(socket.request.headers.host) !== -1
|
||||
&& conf.default_site) {
|
||||
// from currentsite.txt since host is localhost
|
||||
return conf.default_site;
|
||||
}
|
||||
else if (socket.request.headers.origin) {
|
||||
return get_hostname(socket.request.headers.origin);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue