fix: publish realtime to work with localhost (backport #14174) (#14196)

Co-authored-by: leela <leela.vadlamudi@gmail.com>
This commit is contained in:
mergify[bot] 2021-09-14 12:09:01 +05:30 committed by GitHub
parent fa9445a416
commit edea08718c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,9 +265,11 @@ function get_chat_room(socket, room) {
}
function get_site_name(socket) {
var hostname_from_host = get_hostname(socket.request.headers.host);
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 &&
} else if (['localhost', '127.0.0.1'].indexOf(hostname_from_host) !== -1 &&
conf.default_site) {
// from currentsite.txt since host is localhost
return conf.default_site;