Accept again detachable argument for HTTP_AUTHORIZATION.make (..) to avoid breaking existing code.

Note that HTTP_AUTHORIZATION.http_authorization is now detachable.
This commit is contained in:
2013-11-20 09:17:28 +01:00
parent 3d126b04a9
commit 2978ec33b7

View File

@@ -21,9 +21,9 @@ create
make_basic_auth,
make_custom_auth
feature {NONE} -- Initialization
feature -- Initialization
make (a_http_authorization: READABLE_STRING_8)
make (a_http_authorization: detachable READABLE_STRING_8)
-- Initialize `Current'.
local
i: INTEGER
@@ -31,6 +31,13 @@ feature {NONE} -- Initialization
u,p: READABLE_STRING_32
utf: UTF_CONVERTER
do
login := Void
password := Void
if a_http_authorization = Void then
-- Default: Basic
type := basic_auth_type
http_authorization := Void
else
create http_authorization.make_from_string (a_http_authorization)
create t.make_empty
type := t
@@ -65,6 +72,9 @@ feature {NONE} -- Initialization
end
end
end
ensure
a_http_authorization /= Void implies http_authorization /= Void
end
make_basic_auth (u: READABLE_STRING_32; p: READABLE_STRING_32)
-- Create a Basic authentication.
@@ -101,7 +111,7 @@ feature {NONE} -- Initialization
feature -- Access
http_authorization: IMMUTABLE_STRING_8
http_authorization: detachable IMMUTABLE_STRING_8
type: READABLE_STRING_8