Skip to content

Commit e9481cb

Browse files
committed
fix: preserve case-insensitive media URL schemes
1 parent 9652c45 commit e9481cb

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

apps/media-server/src/__tests__/lib/media-size.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ describe("remote media size", () => {
3737
},
3838
});
3939
try {
40-
const result = getSourceSize(`${server.url}video.mp4`);
40+
const result = getSourceSize(
41+
`${server.url}video.mp4`.replace("http:", "HTTP:"),
42+
);
4143
if (sample.size === null) {
4244
await expect(result).rejects.toThrow(
4345
"Media input size is unavailable",

apps/media-server/src/lib/media-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export function normalizeLocalPath(path: string): string {
198198
}
199199

200200
export async function getSourceSize(path: string): Promise<number> {
201-
if (/^https?:\/\//.test(path)) {
201+
if (/^https?:\/\//i.test(path)) {
202202
const response = await mediaFetch(path, {
203203
headers: { Range: "bytes=0-0" },
204204
signal: AbortSignal.timeout(10_000),

0 commit comments

Comments
 (0)