fix: use joi uri validator in appConfig

validate HD_DOMAIN and HD_RENDERER_ORIGIN with the uri validator of Joi. This should prevent the problem described in #2150.

Fixes #2150

See also: https://joi.dev/api/#stringurioptions

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-03-04 00:01:12 +01:00
parent 7e8716ec95
commit 0a778d8a64

View file

@ -17,8 +17,15 @@ export interface AppConfig {
} }
const schema = Joi.object({ const schema = Joi.object({
domain: Joi.string().label('HD_DOMAIN'), domain: Joi.string()
.uri({
scheme: /https?/,
})
.label('HD_DOMAIN'),
rendererOrigin: Joi.string() rendererOrigin: Joi.string()
.uri({
scheme: /https?/,
})
.default(Joi.ref('domain')) .default(Joi.ref('domain'))
.optional() .optional()
.label('HD_RENDERER_ORIGIN'), .label('HD_RENDERER_ORIGIN'),