mirror of
https://github.com/Spengreb/sync.git
synced 2026-05-13 19:22:05 +00:00
Merge pull request #4 from Spengreb/remove-bad-protoswitching
Remove bad protoswitching from previous commit
This commit is contained in:
commit
9d313e1375
2 changed files with 2 additions and 7 deletions
|
|
@ -29,9 +29,7 @@ function checkAdmin(cb) {
|
|||
*/
|
||||
function handleAcp(req, res, _user) {
|
||||
const ioServers = ioConfig.getSocketEndpoints();
|
||||
const preferredSecure = req.realProtocol === 'https';
|
||||
const chosenServer = ioServers.find((server) => server.secure === preferredSecure) ||
|
||||
ioServers[0];
|
||||
const chosenServer = ioServers[0];
|
||||
|
||||
if (!chosenServer) {
|
||||
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) {
|
||||
throw new HTTPError('No socket.io endpoints configured');
|
||||
}
|
||||
const preferredSecure = req.realProtocol === 'https';
|
||||
const chosenEndpoint = endpoints.find((endpoint) => endpoint.secure === preferredSecure) ||
|
||||
endpoints[0];
|
||||
const socketBaseURL = chosenEndpoint.url;
|
||||
const socketBaseURL = endpoints[0].url;
|
||||
|
||||
sendPug(res, 'channel', {
|
||||
channelName: req.params.channel,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue