From 68d3f1088860aaec6a57e7da35e2d2b116463e55 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Thu, 23 Mar 2023 19:42:00 -0700 Subject: [PATCH] rtsp server: fix URL quirk in electron --- common/src/rtsp-server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/rtsp-server.ts b/common/src/rtsp-server.ts index 86bc6d4ab..7734589d8 100644 --- a/common/src/rtsp-server.ts +++ b/common/src/rtsp-server.ts @@ -13,6 +13,7 @@ import { readLength, readLine } from './read-stream'; import { MSection, parseSdp } from './sdp-utils'; import { sleep } from './sleep'; import { StreamChunk, StreamParser, StreamParserOptions } from './stream-parser'; +import { URL } from 'url'; const REQUIRED_WWW_AUTHENTICATE_KEYS = ['realm', 'nonce']; @@ -580,7 +581,7 @@ export class RtspClient extends RtspBase { const username = decodeURIComponent(authedUrl.username); const password = decodeURIComponent(authedUrl.password); - const strippedUrl = new URL(url); + const strippedUrl = new URL(url.toString()); strippedUrl.username = ''; strippedUrl.password = '';