


























@@ -100,12 +100,8 @@ function appendRecentTalkEventMetadata(call: CallRecord, event: TalkEvent): void
100100};
101101}
102102103-function buildRequestUrl(
104-requestUrl: string | undefined,
105-requestHost: string | undefined,
106-fallbackHost = "localhost",
107-): URL {
108-return new URL(requestUrl ?? "/", `http://${requestHost ?? fallbackHost}`);
103+function buildRequestUrl(requestUrl: string | undefined): URL {
104+return new URL(requestUrl ?? "/", "http://localhost");
109105}
110106111107function normalizeProxyIp(value: string | undefined): string | undefined {
@@ -603,7 +599,7 @@ export class VoiceCallWebhookServer {
603599604600private getUpgradePathname(request: http.IncomingMessage): string | null {
605601try {
606-return buildRequestUrl(request.url, request.headers.host).pathname;
602+return buildRequestUrl(request.url).pathname;
607603} catch {
608604return null;
609605}
@@ -644,7 +640,7 @@ export class VoiceCallWebhookServer {
644640req: http.IncomingMessage,
645641webhookPath: string,
646642): Promise<WebhookResponsePayload> {
647-const url = buildRequestUrl(req.url, req.headers.host);
643+const url = buildRequestUrl(req.url);
648644649645if (url.pathname === "/voice/hold-music") {
650646return {
@@ -800,7 +796,7 @@ export class VoiceCallWebhookServer {
800796801797private isRealtimeWebSocketUpgrade(req: http.IncomingMessage): boolean {
802798try {
803-const pathname = buildRequestUrl(req.url, req.headers.host).pathname;
799+const pathname = buildRequestUrl(req.url).pathname;
804800const pattern = this.realtimeHandler?.getStreamPathPattern();
805801return Boolean(pattern && pathname.startsWith(pattern));
806802} catch {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。