diff --git a/patterns/1f0702aaabef60a615abf41f_resources/resources.zip b/patterns/1f0702aaabef60a615abf41f_resources/resources.zip
index d6e5de4..c904a6a 100644
Binary files a/patterns/1f0702aaabef60a615abf41f_resources/resources.zip and b/patterns/1f0702aaabef60a615abf41f_resources/resources.zip differ
diff --git a/patterns/204c22beaccdfd22727af378_labels/labels.zip b/patterns/204c22beaccdfd22727af378_labels/labels.zip
index e28691b..9e96738 100644
Binary files a/patterns/204c22beaccdfd22727af378_labels/labels.zip and b/patterns/204c22beaccdfd22727af378_labels/labels.zip differ
diff --git a/patterns/204c22beaccdfd22727af378_template/webdata.zip b/patterns/204c22beaccdfd22727af378_template/webdata.zip
index 06a0a69..1fb8925 100644
Binary files a/patterns/204c22beaccdfd22727af378_template/webdata.zip and b/patterns/204c22beaccdfd22727af378_template/webdata.zip differ
diff --git a/patterns/3a982aa242ff4f8ebd823693_script/countries_security_filter.lua b/patterns/3a982aa242ff4f8ebd823693_script/countries_security_filter.lua
index 8677552..7d66fb4 100644
--- a/patterns/3a982aa242ff4f8ebd823693_script/countries_security_filter.lua
+++ b/patterns/3a982aa242ff4f8ebd823693_script/countries_security_filter.lua
@@ -1,42 +1,50 @@
package.path = package.path .. ";/opt/nevisproxy/webapp/WEB-INF/lib/lua/Utils.lua"
local Utils = require "Utils"
+validLanguages = {}
+validLanguages["DE"]=true
+validLanguages["FR"]=true
+validLanguages["IT"]=true
+validLanguages["EN"]=true
+validLanguages["RS"]=true
+
function inputHeader(req, resp)
local trace = req:getTracer()
local queryParams = Utils.getQueryParameters(req)
- local path = req:getRequestPath()
+ local pathInfo = req:getPathInfo()
- -- only allow calls to the countries service
- if path == nil then
- trace:error("path is nil")
- end
-
- if path ~= nil and path ~= '/resource/utility/api/v1/countries' then
- trace:info("utility service called with invalid path " .. path)
+ -- only allow calls to the countries service ('api/v1/countries')
+ if pathInfo ~= 'api/v1/countries' then
+ trace:info("utility service called with invalid path " .. pathInfo)
resp:send(404)
return
end
- -- only alloq one query-parameter 'lang' with the values DE, FR, IT, EN, RS
+ -- only allow one query-parameter 'lang' with the values DE, FR, IT, EN, RS
for param, values in pairs(queryParams) do
if (param ~= 'lang') then
trace:info("utility service called with invalid query param " .. param)
resp:send(404)
return
end
- if Helpers.tableLength(values) ~= 1 then
- trace:info("utility service called with invalid value for query param " .. param)
+ local count = 0
+ if values ~= nil then
+ for i, value in pairs(values) do
+ count = count + 1
+ local lang = string.upper(value)
+ if not validLanguages[lang] then
+ trace:info("utility service called with invalid value for query param " .. param .. "=" .. value)
+ resp:send(404)
+ return
+ end
+ end
+ end
+ if count ~= 1 then
+ trace:info("utility service called with invalid values for query param " .. param)
resp:send(404)
return
end
- for i, value in pairs(values) do
- local lang = string.upper(value)
- if not ('DE' == lang or 'FR' == lang or 'IT' == lang or 'EN' == lang or 'RS' == lang) then
- trace:info("utility service called with invalid value for query param " .. param .. "=" .. value)
- resp:send(404)
- return
- end
- end
end
+
end
diff --git a/patterns/4fcfadb4a5c946ead7e6e995_labels/labels.zip b/patterns/4fcfadb4a5c946ead7e6e995_labels/labels.zip
index e28691b..9e96738 100644
Binary files a/patterns/4fcfadb4a5c946ead7e6e995_labels/labels.zip and b/patterns/4fcfadb4a5c946ead7e6e995_labels/labels.zip differ
diff --git a/patterns/4fcfadb4a5c946ead7e6e995_template/webdata.zip b/patterns/4fcfadb4a5c946ead7e6e995_template/webdata.zip
index 06a0a69..1fb8925 100644
Binary files a/patterns/4fcfadb4a5c946ead7e6e995_template/webdata.zip and b/patterns/4fcfadb4a5c946ead7e6e995_template/webdata.zip differ
diff --git a/patterns/584964c837512845d7940809_authStatesFile/recovery-preprocessing.xml b/patterns/584964c837512845d7940809_authStatesFile/recovery-preprocessing.xml
index 9551171..ab6b182 100644
--- a/patterns/584964c837512845d7940809_authStatesFile/recovery-preprocessing.xml
+++ b/patterns/584964c837512845d7940809_authStatesFile/recovery-preprocessing.xml
@@ -207,7 +207,7 @@
-
+
diff --git a/patterns/DefaulErrorPages_ecf4381f4653b0aa9a69b417.yml b/patterns/DefaulErrorPages_ecf4381f4653b0aa9a69b417.yml
index 41428f7..f85a630 100644
--- a/patterns/DefaulErrorPages_ecf4381f4653b0aa9a69b417.yml
+++ b/patterns/DefaulErrorPages_ecf4381f4653b0aa9a69b417.yml
@@ -17,6 +17,8 @@ pattern:
\ true\n \n \n\
\ PlaceHolders\n \n \
\ TransferIdHolder:TRANSFER_ID\n TimestampHolder:TIMESTAMP\n\
- \ \n \n"
- filterMappings: "automatic"
+ \ \n \n\n\n\n\
+ \ DefaultErrorFilter\n /*\n\
+ \ ^/resource/utility/.*$\n\n"
+ filterMappings: "manual"
phase: "START"
diff --git a/patterns/Utility_Resource_Service_eaa622e2a760704c1e0e22f2.yml b/patterns/Utility_Resource_Service_eaa622e2a760704c1e0e22f2.yml
index 0ecbc51..fc98c67 100644
--- a/patterns/Utility_Resource_Service_eaa622e2a760704c1e0e22f2.yml
+++ b/patterns/Utility_Resource_Service_eaa622e2a760704c1e0e22f2.yml
@@ -3,6 +3,7 @@ pattern:
id: "eaa622e2a760704c1e0e22f2"
className: "ch.nevis.admin.v4.plugin.nevisproxy.patterns.RESTServiceAccess"
name: "Utility_Resource_Service"
+ notes: "NOTE/haburger/2024-12-18: The frontend path is excluded in the pattern DefaulErrorPages"
properties:
host:
- "pattern://1f0702aaabef60a615abf41f"