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_basic_auth,
make_custom_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'. -- Initialize `Current'.
local local
i: INTEGER i: INTEGER
@@ -31,6 +31,13 @@ feature {NONE} -- Initialization
u,p: READABLE_STRING_32 u,p: READABLE_STRING_32
utf: UTF_CONVERTER utf: UTF_CONVERTER
do 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 http_authorization.make_from_string (a_http_authorization)
create t.make_empty create t.make_empty
type := t type := t
@@ -65,6 +72,9 @@ feature {NONE} -- Initialization
end end
end end
end end
ensure
a_http_authorization /= Void implies http_authorization /= Void
end
make_basic_auth (u: READABLE_STRING_32; p: READABLE_STRING_32) make_basic_auth (u: READABLE_STRING_32; p: READABLE_STRING_32)
-- Create a Basic authentication. -- Create a Basic authentication.
@@ -101,7 +111,7 @@ feature {NONE} -- Initialization
feature -- Access feature -- Access
http_authorization: IMMUTABLE_STRING_8 http_authorization: detachable IMMUTABLE_STRING_8
type: READABLE_STRING_8 type: READABLE_STRING_8