mirror of
https://github.com/Spengreb/sync.git
synced 2026-05-13 19:22:05 +00:00
Remove bad protoswitching from previous commit
This commit is contained in:
parent
80cd107aa0
commit
6efb8902fa
2 changed files with 2 additions and 7 deletions
|
|
@ -29,9 +29,7 @@ function checkAdmin(cb) {
|
||||||
*/
|
*/
|
||||||
function handleAcp(req, res, _user) {
|
function handleAcp(req, res, _user) {
|
||||||
const ioServers = ioConfig.getSocketEndpoints();
|
const ioServers = ioConfig.getSocketEndpoints();
|
||||||
const preferredSecure = req.realProtocol === 'https';
|
const chosenServer = ioServers[0];
|
||||||
const chosenServer = ioServers.find((server) => server.secure === preferredSecure) ||
|
|
||||||
ioServers[0];
|
|
||||||
|
|
||||||
if (!chosenServer) {
|
if (!chosenServer) {
|
||||||
res.status(500).text("No suitable socket.io address for ACP");
|
res.status(500).text("No suitable socket.io address for ACP");
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,7 @@ export default function initialize(app, ioConfig, chanPath, getBannedChannel) {
|
||||||
if (endpoints.length === 0) {
|
if (endpoints.length === 0) {
|
||||||
throw new HTTPError('No socket.io endpoints configured');
|
throw new HTTPError('No socket.io endpoints configured');
|
||||||
}
|
}
|
||||||
const preferredSecure = req.realProtocol === 'https';
|
const socketBaseURL = endpoints[0].url;
|
||||||
const chosenEndpoint = endpoints.find((endpoint) => endpoint.secure === preferredSecure) ||
|
|
||||||
endpoints[0];
|
|
||||||
const socketBaseURL = chosenEndpoint.url;
|
|
||||||
|
|
||||||
sendPug(res, 'channel', {
|
sendPug(res, 'channel', {
|
||||||
channelName: req.params.channel,
|
channelName: req.params.channel,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue