chore: type cast a couple of cases which should never happen
This commit is contained in:
parent
eaadc91c2d
commit
33b3f130c1
4 changed files with 4 additions and 4 deletions
|
|
@ -22,7 +22,7 @@ export class ConfigureController {
|
|||
}
|
||||
|
||||
private getConfigure(req: Request, res: Response) {
|
||||
const config: Config = JSON.parse(req.params['config'] || JSON.stringify(getDefaultConfig()));
|
||||
const config: Config = JSON.parse(req.params['config'] as string || JSON.stringify(getDefaultConfig()));
|
||||
|
||||
// Convenience preset for ElfHosted WebStreamr bundle including Media Flow Proxy
|
||||
if (!req.params['config'] && isElfHostedInstance(req)) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export class ManifestController {
|
|||
}
|
||||
|
||||
private getManifest(req: Request, res: Response) {
|
||||
const config: Config = JSON.parse(req.params['config'] || JSON.stringify(getDefaultConfig()));
|
||||
const config: Config = JSON.parse(req.params['config'] as string || JSON.stringify(getDefaultConfig()));
|
||||
|
||||
const manifest = buildManifest(this.sources, this.extractors, config);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export class StreamController {
|
|||
|
||||
private async getStream(req: Request, res: Response) {
|
||||
const type: ContentType = (req.params['type'] || '') as ContentType;
|
||||
const rawId: string = req.params['id'] || '';
|
||||
const rawId: string = req.params['id'] as string || '';
|
||||
|
||||
let id: Id;
|
||||
if (rawId.startsWith('tmdb:')) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ export const contextFromRequestAndResponse = (req: Request, res: Response): Cont
|
|||
hostUrl: new URL(`${req.protocol}://${req.host}`),
|
||||
id: res.getHeader('X-Request-ID') as string,
|
||||
...(req.ip && { ip: req.ip }),
|
||||
config: req.params['config'] ? JSON.parse(req.params['config']) : getDefaultConfig(),
|
||||
config: req.params['config'] ? JSON.parse(req.params['config'] as string) : getDefaultConfig(),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue