Improved support of absolute/relative https:// and http:// in http_client.

This commit is contained in:
Jocelyn Fiat
2017-10-17 14:30:44 +02:00
parent 48af63af83
commit f1642a444a

View File

@@ -30,8 +30,15 @@ feature {NONE} -- Initialization
-- Initialize Current with `a_url' and `ctx'. -- Initialize Current with `a_url' and `ctx'.
-- This can be used to reset/reinitialize Current with new url -- This can be used to reset/reinitialize Current with new url
-- in the case of redirection. -- in the case of redirection.
local
i: INTEGER
do do
if a_url.starts_with ("https://") or a_url.starts_with ("http://") then i := a_url.substring_index ("://", 1)
if i > 0 then
check
a_url.substring (1, i).same_string ("http")
or a_url.substring (1, i).same_string ("https")
end
url := a_url url := a_url
else else
url := session.url (a_url, Void) url := session.url (a_url, Void)