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:
Jocelyn Fiat
2017-09-21 10:45:08 +02:00
parent 6425482070
commit 20a90db2e3
2 changed files with 6 additions and 1 deletions

View File

@@ -31,7 +31,11 @@ feature {NONE} -- Initialization
-- This can be used to reset/reinitialize Current with new url
-- in the case of redirection.
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
if ctx /= Void then
context := ctx