feat: Add game activity status (Experimental)
All checks were successful
Queue Release Build / prepare (push) Successful in 21s
Deploy Web Apps / deploy (push) Successful in 5m14s
Queue Release Build / build-windows (push) Successful in 16m18s
Queue Release Build / build-linux (push) Successful in 29m20s
Queue Release Build / finalize (push) Successful in 36s
All checks were successful
Queue Release Build / prepare (push) Successful in 21s
Deploy Web Apps / deploy (push) Successful in 5m14s
Queue Release Build / build-windows (push) Successful in 16m18s
Queue Release Build / build-linux (push) Successful in 29m20s
Queue Release Build / finalize (push) Successful in 36s
This commit is contained in:
@@ -117,8 +117,9 @@ export class ServerEndpointStateService {
|
||||
|
||||
findServerByUrl(url: string): ServerEndpoint | undefined {
|
||||
const sanitisedUrl = this.sanitiseUrl(url);
|
||||
const exactEndpoint = this._servers().find((endpoint) => this.sanitiseUrl(endpoint.url) === sanitisedUrl);
|
||||
|
||||
return this._servers().find((endpoint) => this.sanitiseUrl(endpoint.url) === sanitisedUrl);
|
||||
return exactEndpoint ?? this.findHttpEndpointForHttpsUrl(sanitisedUrl);
|
||||
}
|
||||
|
||||
resolveCanonicalEndpoint(endpoint: ServerEndpoint | null | undefined): ServerEndpoint | null {
|
||||
@@ -447,4 +448,28 @@ export class ServerEndpointStateService {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private findHttpEndpointForHttpsUrl(url: string): ServerEndpoint | undefined {
|
||||
const requestedUrl = this.parseUrl(url);
|
||||
|
||||
if (requestedUrl?.protocol !== 'https:') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return this._servers().find((endpoint) => {
|
||||
const endpointUrl = this.parseUrl(endpoint.url);
|
||||
|
||||
return endpointUrl?.protocol === 'http:'
|
||||
&& endpointUrl.hostname === requestedUrl.hostname
|
||||
&& endpointUrl.port === requestedUrl.port;
|
||||
});
|
||||
}
|
||||
|
||||
private parseUrl(url: string): URL | null {
|
||||
try {
|
||||
return new URL(url);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user