Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.player_.getNetworkingEngine().registerRequestFilter(function (type, request) {
// Only add headers to license requests:
if (type === Shaka.net.NetworkingEngine.RequestType.LICENSE) {
// This is the specific header name and value the server wants:
request.headers['CWIP-Auth-Header'] = 'VGhpc0lzQVRlc3QK'
}
})
shakaPlayer.getNetworkingEngine().registerRequestFilter((type: string, request) => {
if (type === shaka.net.NetworkingEngine.RequestType.LICENSE) {
Object.entries(licenseRequestHeaders).forEach(([key: string, value: string]) => {
request.headers[key] = value;
});
}
});
}