From 78c83a4b698f31167d8aa34a5e3263d226f46d74 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 21 Mar 2013 15:42:16 +0100 Subject: [PATCH] Added HTTP_AUTHORIZATION.is_basic: BOOLEAN query to know if this is a Basic HTTP Authorization. --- .../http_authorization/src/http_authorization.e | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/library/server/authentication/http_authorization/src/http_authorization.e b/library/server/authentication/http_authorization/src/http_authorization.e index 6d1877a7..9e00dc70 100644 --- a/library/server/authentication/http_authorization/src/http_authorization.e +++ b/library/server/authentication/http_authorization/src/http_authorization.e @@ -92,5 +92,19 @@ feature -- Access http_authorization: detachable IMMUTABLE_STRING_8 +feature -- Status report + + is_basic: BOOLEAN + -- Is Basic authorization? + do + if attached type as t then + Result := t.same_string ("basic") + end + end + +invariant + + type_is_lower: attached type as t implies t.same_string (t.as_lower) + end