Update apprelays.js to fix Header issue (#6306)

Add `.trim()` to the header label value (`i`) to fix a rare circumstance where there can be a space in the header name.

GraphicHealer committed Aug 5, 2024 at 17:18 UTC 698b7fb056093e3a9cc24db9299101c18a1fa0b3
1 file changed +1 -1
apprelays.js
+1 -1
@@ -717,7 +717,7 @@ module.exports.CreateWebRelay = function (parent, db, args, domain, mtype) {
717 }
718 }
719 }
720 - else if (blockHeaders.indexOf(i) == -1) { obj.res.set(i, header[i]); } // Set the headers if not blocked
720 + else if (blockHeaders.indexOf(i) == -1) { obj.res.set(i.trim(), header[i]); } // Set the headers if not blocked
721 }
722 obj.res.set('Content-Security-Policy', "default-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:;"); // Set an "allow all" policy, see if the can restrict this in the future
723 //obj.res.set('Content-Security-Policy', "default-src * 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * 'unsafe-inline';"); // Set an "allow all" policy, see if the can restrict this in the future