better assertion to ensure `base' is a valid base url
This commit is contained in:
@@ -20,9 +20,11 @@ create
|
|||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make_with_base (a_app: like application; a_base: like base)
|
make_with_base (a_app: like application; a_base: like base)
|
||||||
|
require
|
||||||
|
a_base_starts_with_slash: (a_base /= Void and then not a_base.is_empty) implies a_base.starts_with ("/")
|
||||||
do
|
do
|
||||||
make (a_app)
|
make (a_app)
|
||||||
base := a_base
|
set_base (a_base)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
@@ -52,8 +54,12 @@ feature -- Access
|
|||||||
feature -- Element change
|
feature -- Element change
|
||||||
|
|
||||||
set_base (b: like base)
|
set_base (b: like base)
|
||||||
|
require
|
||||||
|
b_starts_with_slash: (b /= Void and then not b.is_empty) implies b.starts_with ("/")
|
||||||
do
|
do
|
||||||
base := b
|
base := b
|
||||||
|
ensure
|
||||||
|
valid_base: (attached base as l_base and then not l_base.is_empty) implies l_base.starts_with ("/")
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Server
|
feature -- Server
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ feature {NONE} -- Implementation
|
|||||||
|
|
||||||
make_custom (a_callback: like {WGI_AGENT_APPLICATION}.callback; a_base_url: detachable STRING)
|
make_custom (a_callback: like {WGI_AGENT_APPLICATION}.callback; a_base_url: detachable STRING)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
|
require
|
||||||
|
base_url_starts_with_slash: (a_base_url /= Void and then not a_base_url.is_empty) implies a_base_url.starts_with ("/")
|
||||||
local
|
local
|
||||||
app: WGI_AGENT_APPLICATION
|
app: WGI_AGENT_APPLICATION
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user