From 0263865faa26271e000c7334465ee6723e0fdab1 Mon Sep 17 00:00:00 2001 From: Maxime Besson Date: Thu, 12 Nov 2020 14:34:16 +0100 Subject: [PATCH] Add CORS headers to error pages (#2380) --- .../lib/Lemonldap/NG/Common/PSGI.pm | 27 ++++++++++++------- .../lib/Lemonldap/NG/Portal/Main/Run.pm | 12 +++++++++ .../t/01-CSP-and-CORS-headers.t | 8 ++++++ 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm index 01241ece0..bbb722e1c 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm @@ -191,6 +191,8 @@ sub sendError { : $code == 400 ? 'Bad request' : 'Error' ); + + # TODO: this should probably use a template instead my $s = "$title