fix: isHLSRequest -> isHlsRequest

This commit is contained in:
mikhail 2024-05-30 17:23:09 +05:00
parent 87a6428dde
commit 21e224bd14
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ function transformMediaPlaylist(streamInfo, hlsPlaylist) {
const HLS_MIME_TYPES = ["application/vnd.apple.mpegurl", "audio/mpegurl", "application/x-mpegURL"];
export function isHLSRequest (req) {
export function isHlsRequest (req) {
return HLS_MIME_TYPES.includes(req.headers['content-type']);
}

View File

@ -2,7 +2,7 @@ import { request } from 'undici';
import { Readable } from 'node:stream';
import { assert } from 'console';
import { getHeaders } from './shared.js';
import { handleHlsPlaylist, isHLSRequest } from './internal-hls.js';
import { handleHlsPlaylist, isHlsRequest } from './internal-hls.js';
const CHUNK_SIZE = BigInt(8e6); // 8 MB
const min = (a, b) => a < b ? a : b;
@ -98,7 +98,7 @@ export async function internalStream(streamInfo, res) {
if (req.statusCode < 200 || req.statusCode > 299)
return res.end();
if (isHLSRequest(req)) {
if (isHlsRequest(req)) {
await handleHlsPlaylist(streamInfo, req, res);
} else {
req.body.pipe(res);