var determineWebcamStreamType = function (streamUrl) {
    if (streamUrl) {
        if (streamUrl.startsWith("webrtc")) {
            return "webrtc";
        }

        var lastDotPosition = streamUrl.lastIndexOf(".");
        var firstQuotationSignPosition = streamUrl.indexOf("?");
        if (
            lastDotPosition != -1 &&
            firstQuotationSignPosition != -1 &&
            lastDotPosition >= firstQuotationSignPosition
        ) {
            throw "Malformed URL. Cannot determine stream type.";
        }

        // If we have found a dot, try to extract the extension.
        if (lastDotPosition > -1) {
            if (firstQuotationSignPosition > -1) {
                var extension = streamUrl.slice(
                    lastDotPosition + 1,
                    firstQuotationSignPosition - 1
                );
            } else {
                var extension = streamUrl.slice(lastDotPosition + 1);
            }
            if (extension.toLowerCase() == "m3u8") {
                return "hls";
            }
        }
        // By default, 'mjpg' is the stream type.
        return "mjpg";
    } else {
        throw "Empty streamUrl. Cannot determine stream type.";
    }
};
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.