If url is relative, use session.url (...) to get valid url.
It could happen with relative url in `Location: ...` header (for redirection).
This commit is contained in:
@@ -31,7 +31,11 @@ feature {NONE} -- Initialization
|
|||||||
-- 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.
|
||||||
do
|
do
|
||||||
url := a_url
|
if a_url.starts_with ("http://") or a_url.starts_with ("http://") then
|
||||||
|
url := a_url
|
||||||
|
else
|
||||||
|
url := session.url (a_url, Void)
|
||||||
|
end
|
||||||
headers := session.headers.twin
|
headers := session.headers.twin
|
||||||
if ctx /= Void then
|
if ctx /= Void then
|
||||||
context := ctx
|
context := ctx
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ feature -- Access
|
|||||||
-- Get URL data
|
-- Get URL data
|
||||||
l_is_https := url.starts_with_general ("https://")
|
l_is_https := url.starts_with_general ("https://")
|
||||||
create l_uri.make_from_string (url)
|
create l_uri.make_from_string (url)
|
||||||
|
check valid_url: l_uri.is_valid end
|
||||||
l_port := l_uri.port
|
l_port := l_uri.port
|
||||||
if l_port = 0 then
|
if l_port = 0 then
|
||||||
if l_is_https then
|
if l_is_https then
|
||||||
|
|||||||
Reference in New Issue
Block a user