fix: matrix rtc mapping

This commit is contained in:
Katharina Heidenreich 2026-04-06 13:22:22 +02:00
parent 1a3d1f1fdd
commit 20f8049d64
4 changed files with 49 additions and 15 deletions

View file

@ -5,7 +5,7 @@ let
allowedProxyContentKeys = [ "type" "ip" "port" "proxyWebsockets" ];
allowedWebContentKeys = [ "type" "files" ];
allowedWebFileKeys = [ "path" "filePath" "contentType" "status" ];
allowedInlineContentKeys = [ "body" "contentType" "status" ];
allowedInlineContentKeys = [ "body" "contentType" "headers" "status" ];
allowedRedirectContentKeys = [ "target" "status" ];
ensureNoUnknownKeys = context: obj: allowedKeys:
@ -168,6 +168,20 @@ let
null
else
throw "Inline endpoint at index ${toString index} content.contentType must be a non-empty string when provided.";
________ =
if contentValue ? headers then
if builtins.isAttrs contentValue.headers then
let
headerValues = builtins.attrValues contentValue.headers;
in
if lib.all (value: builtins.isString value && value != "") headerValues then
null
else
throw "Inline endpoint at index ${toString index} content.headers values must be non-empty strings."
else
throw "Inline endpoint at index ${toString index} content.headers must be an attrset when provided."
else
null;
_______ =
if !(contentValue ? status) || builtins.isInt contentValue.status then
null