From dd63042ec46aa3f625038520cbe604dc1530d770 Mon Sep 17 00:00:00 2001 From: Colin Adams Date: Sun, 17 Mar 2013 10:38:00 +0000 Subject: [PATCH] Added missing class --- .../router/wsf_system_options_access_policy.e | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 library/server/wsf/router/wsf_system_options_access_policy.e diff --git a/library/server/wsf/router/wsf_system_options_access_policy.e b/library/server/wsf/router/wsf_system_options_access_policy.e new file mode 100644 index 00000000..6915af52 --- /dev/null +++ b/library/server/wsf/router/wsf_system_options_access_policy.e @@ -0,0 +1,40 @@ +note + + description: "[ + Policy to decide if OPTIONS * is honoured. + Servers that wish to forbid OPTIONS * requests + can redefine `is_system_options_forbidden'. + + Response 403 Forbidden is meant to be accompanied + by an entity body describing the reason for the refusal. + Since authentication cannot be used for OPTIONS *, there + are limited grounds for selective refusal (the IP address might + be used though), so we provide a convenient default for + `system_options_forbidden_text'. + ]" + + date: "$Date$" + revision: "$Revision$" + +class WSF_SYSTEM_OPTIONS_ACCESS_POLICY + +feature -- Access + + is_system_options_forbidden (req: WSF_REQUEST): BOOLEAN + -- Should we return 403 Forbidden in response to OPTIONS * requests? + require + req_attached: req /= Void + do + -- by default, unconditionally no. + end + + system_options_forbidden_text (req: WSF_REQUEST): detachable READABLE_STRING_8 + -- Content of 403 Forbidden response; + -- Returning `Void' means instead respond with 403 Not found + require + req_attached: req /= Void + do + Result := "OPTIONS * is not permitted" + end + +end