mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Use encrypted field to check for TLS.
This commit is contained in:
committed by
Joachim Van Herwegen
parent
bc088f494d
commit
82f90709a6
@@ -1,4 +1,5 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import type { TLSSocket } from 'tls';
|
||||
import type { WebSocket } from 'ws';
|
||||
import { getLoggerFor } from '../logging/LogUtil';
|
||||
import type { HttpRequest } from '../server/HttpRequest';
|
||||
@@ -47,7 +48,7 @@ class WebSocketListener extends EventEmitter {
|
||||
// Store the HTTP host and protocol
|
||||
const forwarded = parseForwarded(headers);
|
||||
this.host = forwarded.host ?? headers.host ?? 'localhost';
|
||||
this.protocol = forwarded.proto === 'https' || (socket as any).secure ? 'https:' : 'http:';
|
||||
this.protocol = forwarded.proto === 'https' || (socket as TLSSocket).encrypted ? 'https:' : 'http:';
|
||||
}
|
||||
|
||||
private stop(): void {
|
||||
|
||||
Reference in New Issue
Block a user